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

Fred Drake <[email protected]>
Newsgroups gmane.comp.python.web
Message-ID <[email protected]>
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.

I advocated using the just-dotted notation.  These references are found in
configurations, usually constructed users of the components rather than
implementors of the components.  This is different than for entry points,
where the entry point specification uses module:object, but is provided by
the package maintainer.

These end users don't really care if the object identified is a class or
function in module, a nested attribute on a class, or anything else, so
long as it does what it's advertised to do.  By not pushing implementation
details into the identifier, the package maintainer is free to change the
implementation in more ways, without creating backward incompatibility.

Jim's note about having an expression after the colon is interesting;
not sure if that's a helpful case for packaging's use or not.


  -Fred

-- 
Fred L. Drake, Jr.    <fdrake at acm.org>
"Give me the luxuries of life and I will willingly do without the necessities."
   --Frank Lloyd Wright
_______________________________________________
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.