[Python-Dev] PEP 376 : Changing the .egg-info structure (original) (raw)

Tarek Ziadé ziade.tarek at gmail.com
Wed May 20 11:48:59 CEST 2009


On Tue, May 19, 2009 at 10:36 PM, P.J. Eby <pje at telecommunity.com> wrote:

Now, about the APIs... I think it would be simpler to have explicit object types representing things like a directory, a collection of directories, and individual projects, and these object types should be part of the API. Any function-oriented API should just be exposed as the methods of a default singleton.  Other Python modules follow this pattern -- and it's what I copied for the pkgresources design.  It gives a nice tradeoff between keeping the simple things simple, and complex things possible, as well as keeping mechanism and policy separate. Right now, the API design you're trying to do is being burdened by using strings and tuples to represent things that could just as easily be objects with their own methods, instead of things you have to pass back into other APIs.  This also makes caching more complex, because you can't just have one main object with stuff hanging off; you've got to have a bunch of dictionaries, tuples, lists, sets, etc.

I don't know how other people work on building APIs in PEPs, but at this stage I am unable to work them on the paper, without having a prototype to try things out.

So I guess I'll start this prototype in bitbucket and come back with it for feedback in Distutils-SIG, for a new PEP 376 round.

Tarek

-- Tarek Ziadé | http://ziade.org



More information about the Python-Dev mailing list