[Python-Dev] Re: new syntax for wrapping (PEP 318)
Moore, Paul
Paul.Moore at atosorigin.com
Thu Feb 26 04:20:39 EST 2004
From: Jewett, Jim J
> Agreed. And why limit it to lists - why not any expression that
> evaluates to a list? Or maybe any sequence? Which is one reason
> that a bare "[...]" doesn't seem sufficient.
Overgeneralisation without good use cases. Leave it as simple lists.
Bob Ippolito just posted a pseq function which will do this for the
(extremely rare) cases when it might be needed.
> They don't need to, in general. The specific functions that they
> do need (like __init__) are in the index. Though to be honest,
> this was a concern at first, when I thought that creating a class would
> require me to define a large number of methods. If I had been more
> deeply object-oriented, that might have put me off. Instead, I just
> started with functions instead of classes.
Exactly. As a beginner, classes were more advanced than you needed.
So the (relative) difficulty of finding the relevant details wasn't
an issue - you just didn't use the feature for a while. By the time
you needed classes, you were familiar enough with Python to know where
to look.
Heck, by the time most people will need the full power of the wrapping
feature [1], they will probably know enough to understand the C code of
the patch itself! It's pretty advanced usage, remember...
[1] Except for extremely stylised cases like [classmethod], which will
be for particular use cases - and you can look that one up under
"classmethod"...
Paul.
More information about the Python-Dev
mailing list