ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> import-sig
import-sig
Re: [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import mechanism.
by Barry A. Warsaw other posts by this author
Nov 13 2001 6:01AM messages near this date
Re: [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import mechanism. | Re: [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import mechanism.
> >>>> "PR" == Prabhu Ramachandran <prabhu@[...].in> writes:

    PR>    (1) Re-nesting a package is a pain.  What I mean by
    PR>  re-nesting is that say I have a package, A, that is separate
    PR>  (and that has its own sub packages) and now I want it as part
    PR>  of another package, B.

Why would you want to do that?  Why not just keep them separate
top-level packages that cooperate?  Or export A's names in B's
modules?  I think distutils helps out here because it's now easy to
install A in a way that B could just use, or add to.

FWIW, we knit things together as well, e.g. with StandaloneZODB.  It's
got a bunch of top-level packages that are treated as a single entity
via a figment of CVS's imagination.  So what if it installs a bunch of
separate top-level package names that aren't all treed under a single
package?
    
    PR>  Lets further suppose that the module which re-nests the
    PR>  package, B, tracks the development of A and keeps their copy
    PR>  updated.

Okay.
    
    PR>  In this case A is developed as a standalone package and B adds
    PR>  something to it that A cannot/refuses to use.

Okay.
    
    PR>  With the current approach B would be forced to modify A every
    PR>  time A changes in some significant way simply because A was
    PR>  re-nested.  Yes, this is contrived but such situations do
    PR>  occur.

Why does B have to add packages to A's namespace?  Why can't the B
author simply use distutils to ensure that vanilla A is installed,
import the bits and pieces of A that you want to expose, overriding
what you want to change, and export an interface through B that
clients can use instead of A?  I.e. through the use of "from foo
import bar" and "from foo import bar as baz", you can present whatever
public interface you want, through B's namespace, and mimic as much or
as little of A's as you want.

    PR>  Its not the application that I'm concerned about - an
    PR>  application is typically a single/few file(s) and editing them
    PR>  to suit things is certainly not an issue.

Well, not /all/ applications!
    
    JH>  I expect there is more to the issue than just wanting to avoid
    JH>  some extra typing.  A short PEP that describes the specific
    JH>  problems being solved and discussing alternatives would help.

    BAW>  Indeed.  We've been here before (perhaps, several "befores"
    BAW>  :).  Every time this comes up I get the feeling like there
    BAW>  are easy ways to accomplish what you want if you think of the

    PR>  So do I need to write a PEP?  Is there some special
    PR>  formality/format I need to keep in mind?

PEP 1 and PEP 9 are your guidelines to proper PEP form and procedure.

    BAW>  Are the needs of application authors different than library
    BAW>  authors?

    PR>  I would think so.

That would be good to outline in your PEP then <wink> .

-Barry

_______________________________________________
Import-sig mailing list
Import-sig@[...].org
http://mail.python.org/mailman/listinfo/import-sig
Thread:
eric
Prabhu Ramachandran
Prabhu Ramachandran
Prabhu Ramachandran
Gordon McMillan
James C. Ahlstrom
Barry A. Warsaw
Gordon McMillan
Toby Dickenson
Steve Holden
Barry A. Warsaw
Prabhu Ramachandran
Barry A. Warsaw
Fredrik Lundh
Barry A. Warsaw
Prabhu Ramachandran
Prabhu Ramachandran
Prabhu Ramachandran
Barry A. Warsaw
Michel Pelletier
Prabhu Ramachandran
Michel Pelletier
James C. Ahlstrom
Prabhu Ramachandran
Prabhu Ramachandran
Prabhu Ramachandran
eric
Prabhu Ramachandran
eric
Gordon McMillan
Toby Dickenson
M.-A. Lemburg
Barry A. Warsaw
Fredrik Lundh
Prabhu Ramachandran
Barry A. Warsaw
Michel Pelletier
Prabhu Ramachandran
James C. Ahlstrom
Gordon McMillan
Barry A. Warsaw
Prabhu Ramachandran
Prabhu Ramachandran
Barry A. Warsaw
Prabhu Ramachandran
James C. Ahlstrom
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Prabhu Ramachandran
Greg Ward
Just van Rossum
Thomas Heller
Just van Rossum
Jeremy Hylton
Gordon McMillan
Gordon McMillan
Gordon McMillan
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Jeremy Hylton
Jeremy Hylton
eric
Prabhu Ramachandran
Gordon McMillan
Prabhu Ramachandran
Gordon McMillan
Prabhu Ramachandran

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved