typing icon indicating copy to clipboard operation
typing copied to clipboard

Add conformance test for `@final` combined with `@property`

Open samwgoldman opened this issue 9 months ago • 4 comments

The language of the typing spec indicates that the @final decorator may be used with properties:

The method decorator version may be used with all of instance methods, class methods, static methods, and properties.

I noticed this case while working on Pyre. I observed that Mypy and Pyright also differ in behavior, so it seemed like a good conformance test to add.

See discussion here: https://discuss.python.org/t/proposal-allow-chaining-final-decorator-when-previous-decorators-return-a-non-function/78918

I also added an example to the spec itself. I think it's a practical example, but also happy to remove it as well, since the existing content makes it pretty clear that the example should be allowed.

samwgoldman avatar Jan 31 '25 05:01 samwgoldman