Re: OT: dotted names (Was: Re: A Python Web Application Package and Format)

"P.J. Eby" <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]>
Newsgroups gmane.comp.python.web
Message-ID <[email protected]>
At 02:02 PM 4/15/2011 -0400, Jim Fulton wrote:
>On Fri, Apr 15, 2011 at 1:32 PM, Éric Araujo <[email protected]> wrote:
> > As an aside, I wonder why people use dot+colon notation instead of just
> > dots to reference callables.  In distutils2 for example we resolve
> > dotted names to find command classes, command hooks and compilers.  So
> > what's the benefit, marginally easier parsing?
>
>An opportunity of using a colon is that it allows::
>
>    dotted.module.name:expression
>
>where expression may be more than just a name::
>
>
>   foo.bar:Bar()


The reason setuptools uses ':' is that it allows you to unambiguously 
reference object attributes, e.g.:

    some.module:SomeClass.some_method_or_attribute

(It doesn't allow expressions, just dotted "paths".)

_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.