Change by Saumitro Dasgupta :
--
resolution: -> wont fix
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Saumitro Dasgupta added the comment:
Fair enough. If that's the consensus, I'll close the issue.
--
___
Python tracker
<https://bugs.python.o
Saumitro Dasgupta added the comment:
I'd argue that the situation is a bit different from class variables here,
since __annotations__ is indirectly brought into existence by the presence of
statically-established type annotations. You can be perfectly aware of how
class variables wor
Saumitro Dasgupta added the comment:
In my opinion, the main problem here is the element of surprise. Given a
statement like this:
foo.__annotations__['injected'] = bool
the expressed intent is "extend this object's annotations". It's surprising
t
New submission from Saumitro Dasgupta :
Adding type annotations at runtime may lead to inconsistent results. Consider
the following example:
class Base:
base: int
class Alpha(Base):
pass
class Beta(Base):
foobar: int
# Case 1: This mutates Base