Bug in __init__?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jan 21 14:38:10 EST 2008


En Mon, 21 Jan 2008 05:59:38 -0200, <cokofreedom at gmail.com> escribi�:

> Is there no way of adding a possible warning message (that obviously
> could be turned off) to warn users of possible problems linked to
> using mutable types as parameters?
>
> Seems to me this could save users a few minutes/hours of headaches and
> headscratching. (The biggest issue affecting new programmers these
> days!)

Most objects are mutable, such warning would happen so often that would  
become useless.
The only immutable objects are numbers, strings, tuples, None and a few  
esoteric types; all other instances, including instances of all user  
defined classes, are mutable unless explicitely their attributes are  
read-only.

-- 
Gabriel Genellina




More information about the Python-list mailing list