Possible wart in PEP-0253

Aahz Maruch aahz at panix.com
Fri Sep 21 18:21:21 CEST 2001


In article <slrn9qco9s.88o.ZnickZm at localhost.localdomain>,
Nick Mathewson <ZnickZm at alum.mit.edu> wrote:
>
>My suggestion is this: would it be possible to relax the
>assignment-to-__dict__ rule at least so far that if __dict__ is None,
>you can assign a new empty __dict__?  Or add to a declaration
>(__init_dict__?) that makes the metaclass always materialize an empty
>__dict__ when __new__ is called?
>
>Otherwise, from now on, the generic way to spell 
>         "self.__dict__['foo'] = bar" 
>will be instead
>         "object.__setattr__(self,'foo',bar)".
>Except that: for classes that don't extend types, the first spelling
>will continue to work.  And for classes that *do* extend types, the
>first spelling will work in all cases but the first.
>
>Though I can quite gladly accept that this is as intended, it
>certainly took me a while to figure it out for myself. :)
>
>So, what ought I do? Submit this to sourceforge?  To the FAQ?  Or just
>accept that PEP-0253 is heavy business, and try to come to terms with
>it on my own? :)

I'd suggest sending this to python-dev at python.org for discussion.  I've
just restarted discussion there about some other aspects of dynamic
attributes.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

We must not let the evil of a few trample the freedoms of the many.



More information about the Python-list mailing list