On Fri, Apr 15, 2011 at 1:32 PM, Éric Araujo <merwok@netw...> 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.