Message410298
Currently, @typing.final is implemented as an identity function, which makes it impossible for type checkers that look at runtime objects to support it.
I propose that we implement it as something like:
def final(f):
try:
f.__final__ = True
except AttributeError:
pass # in case it is used on an object that doesn't support setting attributes
return f
I will submit a PR implementing this idea. |
|
Date |
User |
Action |
Args |
2022-01-11 12:10:26 | JelleZijlstra | set | recipients:
+ JelleZijlstra, gvanrossum, kj |
2022-01-11 12:10:25 | JelleZijlstra | set | messageid: <1641903025.56.0.417443155132.issue46342@roundup.psfhosted.org> |
2022-01-11 12:10:25 | JelleZijlstra | link | issue46342 messages |
2022-01-11 12:10:25 | JelleZijlstra | create | |
|