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.
2 parents 6d47001 + 1ba02ca commit ced2668Copy full SHA for ced2668
src/future/types/newobject.py
@@ -112,5 +112,6 @@ def __native__(self):
112
"""
113
return object(self)
114
115
+ __slots__ = []
116
117
__all__ = ['newobject']
tests/test_future/test_object.py
@@ -274,6 +274,16 @@ def __len__(self):
274
275
self.assertFalse(bool(FalseThing()))
276
277
+ def test_cannot_assign_new_attributes_to_object(self):
278
+ """
279
+ New attributes cannot be assigned to object() instances in Python.
280
+ The same should apply to newobject.
281
282
+ from builtins import object
283
+
284
+ with self.assertRaises(AttributeError):
285
+ object().arbitrary_attribute_name = True
286
287
288
if __name__ == '__main__':
289
unittest.main()
0 commit comments