KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
For example, this code is Python: a = object() a.b = 3 throws AttributeError: 'object' object has no attribute 'b' But, this piece of code: class c(object): pass a = c() a.b = 3 is just fine. Why can I assign property b, when class x does not have that property? How can I make my classes have only properties defined?
Tags (comma-separated)
Save Edits
Cancel