[Distutils] distribute 0.6.10 and convert_2to3_doctests

P.J. Eby pje at telecommunity.com
Sun Jan 31 03:51:34 CET 2010


At 07:08 PM 1/30/2010 -0500, Barry Warsaw wrote:
>On Jan 29, 2010, at 11:03 PM, Tarek Ziadé wrote:
>
> >Yes, that's how Jinja does already for example, using Setuptools's
> >pkg_resources :
> >
> >__version__ = __import__('pkg_resources').get_distribution('Jinja2').version
>
>And that's different yet again from what PJE suggests.

Not really; just a different way of spelling the same thing.  In 
either case, you're looking at the .version attribute of the 
Distribution instance.


>   This is screaming for
>a blessed API to be pushed into the stdlib.
>
>(BTW, why use __import__() there?)

It lets you save an extra line to import pkg_resources; that's really 
the only difference.



More information about the Distutils-SIG mailing list