Closed TobiasHT5 closed 2 years ago
This is not really a bug as I observed later, but a consequence of all objects being subclasses of the BaseObject class. This means even though the indivdual subclasses have __slots__
, the base class still as the __dict__
and items are being added to that dict. This is a sort of good thing because __slots__
imposes as a hard limit on the number of attributes to have in a given class, which would raise errors if the parser passed attributes to any object that doesn't expect them. This has triggered a thought in me of how to include a mechanism that gracefully adapts the codebase to new telegram API versions being released. I'll be working on this
Currently, the test is designed to help track any new fields being added to telegram bot api as version 6.3 is progressing. A specific area of the test relies on the ability for an object to raise AttributeError when an attribute not explicitly listed in the
__slots__
tuple of that has been assigned to it. The unfortunate bit is that any attributes that don't exist in the__slots__
are being successfully added to object withsetattr
and therefore are not triggering the AttributeError to record them. I have not figured out why the AttributeError is not being triggered as yet, but I'm making a quick fix to the test