We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39a066e commit 1ba02caCopy full SHA for 1ba02ca
src/future/types/newobject.py
@@ -130,5 +130,6 @@ def __native__(self):
130
"""
131
return object(self)
132
133
+ __slots__ = []
134
135
__all__ = ['newobject']
tests/test_future/test_object.py
@@ -271,6 +271,16 @@ def __len__(self):
271
272
self.assertFalse(bool(FalseThing()))
273
274
+ def test_cannot_assign_new_attributes_to_object(self):
275
+ """
276
+ New attributes cannot be assigned to object() instances in Python.
277
+ The same should apply to newobject.
278
279
+ from builtins import object
280
+
281
+ with self.assertRaises(AttributeError):
282
+ object().arbitrary_attribute_name = True
283
284
285
if __name__ == '__main__':
286
unittest.main()
0 commit comments