can't add variables to instances of built-in classes

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Wed Jul 20 18:11:26 EDT 2016


On Wednesday, July 20, 2016 at 9:16:30 PM UTC+12, Peter Otten wrote:
>
> Lawrence D’Oliveiro wrote:
> 
>> On Wednesday, July 20, 2016 at 7:26:36 PM UTC+12, Peter Otten wrote:
>> 
>>> pylint can detect candidates for accidental attribute creation:
>> 
>> And __slots__ will prevent them outright.
> 
> And attributes added intentionally.

You mean, being able to dynamically add new attributes to an object?

Probably not a good idea to mix that with read/write properties...



More information about the Python-list mailing list