At 04:35 PM 6/8/2009 +0100, Paul Moore wrote:
2009/6/8 Ronald Oussoren firstname.lastname@example.org:
The thingy we're getting is called an "EggInfo", which would IMHO mean that "get_egg_infos" is technically the correct name for something
that returns a
list of them. I'd interpret the singular form as a function that
That's the place I mean. But I'm not sure I like the idea of calling it an "EggInfo". I'll see if I can think of a better name (but not being familiar with the domain, I'm not sure I'll be able to).
FWIW, pkg_resources uses "Distribution", and it has functions such as find_distributions().
Glancing over the EggInfo, EggInfoDirectories, and EggInfoDirectory APIs, it might be interesting if these were able to match with the PEP 3119 interfaces (http://www.python.org/dev/peps/pep-3119/).
For example, the EggInfoDirectories has __iter__, append, clear and remove methods, but the source code comments list them as 'container APIs'. Technically though, that's an Iterable interface and a partial implementation of the MutableSequence interface.
The EggInfoDirectories.get_egg_infos(project_name) is also suggestive of the Mapping interface - if this method was shortened from get_egg_infos() to just get().
Maybe it would be confusing if an EggInfoDirectories was a MutableSequence which could only have paths added to it, but returned an iterable of EggInfoDirectory, but could also be accessed as a Mapping where the keys are project names and those values are EggInfos ... but maybe something along those lines would work?