[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-dev
Subject:    Re: [Python-Dev] PEP 344: Exception Chaining and Embedded Tracebacks
From:       Aahz <aahz () pythoncraft ! com>
Date:       2005-05-17 13:36:17
Message-ID: 20050517133617.GA2146 () panix ! com
[Download RAW message or body]

On Mon, May 16, 2005, Guido van Rossum wrote:
>
> My rule has more to do with who "owns" the namespace on the one hand,
> and with "magic" behavior caused (or indicated) by the presence of the
> attribute on the other. Class or instance is irrelevant; that most
> magic attributes live on classes or modules is just because those are
> places where most of the magic is concentrated.
> 
> __init__ in a class is a system attribute because it has a magic
> meaning (invoked automatically on instantiation). __file__ and
> __name__ in a module (and __module__ and __name__ in a class!) are
> system attributes because they are "imposing" on the user's use of the
> namespace. (Note: next was a mistake; it should have been __next__
> because of the "magic" rule.)

>From my POV, part of the reasoning should be the extent to which the
attribute is intended to be publicly accessible -- part of the primary
documented interface.  __init__ is magic, fine.  But __name__ isn't part
of the primary use for a class, whereas these new exception attributes
will be part of the public interface for exceptions, just like the
methods for the Queue class.  (I'm using Queue in specific because it's
intended to be subclassed.)
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"And if that makes me an elitist...I couldn't be happier."  --JMS
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic