[py-dev] Future export interface
holger krekel
hpk at trillke.net
Wed Jun 8 15:49:07 CEST 2005
Hi David,
On Wed, Jun 08, 2005 at 08:12 -0400, David Stanek wrote:
> I want to get my hands a little dirty by playing with the
> export/import changes that are in the future document. The example
> of the new specification looks like:
>
> from py import pkg
> pkg.export(__name__,
> pkg.Class('local', 'doc comment', extpy='./path/local.LocalPath'),
> pkg.Class('svnurl', 'doc comment',
> extpy='./path/local/svn/urlcommand.SvnUrlPath'),
> ),
> # it goes on ...
> )
>
> I was thinking about how this would look a little and I am unsure of it.
>
> The keyword arguments that are currently passed to initpkg are missing
> from the example and adding them in to the export call may look clumsy.
> I was thinking of something like:
>
> from py import pkg
> exporter = pkg.Exporter(__name__, description, version, url, etc...)
> exporter.exportModule('path', 'doc comment',
> pkg.Class('local', 'doc comment', extpy='./path/local.Localpath'),
> pkg.Class('svnurl', 'doc comment',
> extpy='./path/local/svn/urlcommand.SvnUrlPath'),
> # more exported classes
> )
> exporter.exportModule('junk', 'doc comment',
> pkg.Module('stuff', 'doc comment',
> pkg.Class('Stuff', 'comment')
> )
> )
>
> That is an attempt to flatten the data structure and make it more
> readable.
That's basically interesting but i think we shouldn't work on that
before the 0.8 release is out. However, after the current import/export
mechanisms seems to be be pretty stable i am more hesitant to go
after a big scale change. Just going for a minimal way to add docstrings
to the current dictionary-based export specification seems more worthwhile.
Side note: I am still heading towards getting an issue tracker up for
organizing the remaining issues before the release.
cheers,
holger
More information about the py-dev
mailing list