[Python-3000] pep 3124 plans (original) (raw)

Guido van Rossum guido at python.org
Thu Jul 19 01:59:52 CEST 2007


On 7/18/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

Guido van Rossum wrote: > Sorry, but I'm still totally uncomfortable with this. While I admit > the feature exists, I really, really, really don't want it to be used > on a regular basis.

As long as the objects defined by a regular def statement aren't modifiable, it seems like it won't be possible to support retroactive generification of functions that haven't initially been defined as generic somehow. So effectively you're saying that you're against this, or willing to forego it? Not arguing one way or the other, just seeking to clarify your position.

The only approach to retroactive generification that I approve of is replacing the entire object with a wrapper of sorts, e.g.

foo = generify(foo)

or (more likely)

import bar bar.foo = generify(bar.foo)

I know this has a downside when someone else did "from bar import foo" before the generification was applied; that is a general problem with "from foo import bar" and should be addressed by not using that style in cases where this matters. (It is fine for importing a submodule from a package of course.)

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-3000 mailing list