Comment on draft PEP for deprecating six builtins

Paul Boddie paul at boddie.net
Tue Apr 30 11:57:41 EDT 2002


Bernhard Herzog <bh at intevation.de> wrote in message news:<6qvga9bizr.fsf at abnoba.intevation.de>...
> 
> Why should chr be an int method in the first place? It's not tied to
> ints all that much[1]. IMO it sits somewhere between ints (including
> int-like objects !) and strings so it shouldn't be a method of either
> class. Leaving it a function is perfectly fine, therefore, although
> putting it into the string module might be a good idea. The same would
> apply to ord, IMO.

Indeed. The mistake the Java API designers made with their "standard"
classes was to invent shedloads of different methods to convert one
type/class to another, giving lots of different possibilities and
bloating the API to new, undiscovered heights/depths. For anyone in
any doubt about this, take a look at java.lang.String/Long/Integer
etc. to see what I mean.

But then I still have problems remembering if one should use...

  "/".split("a/b/c")

or

  "a/b/c".split("/")

...so perhaps I'm not sufficiently "into" the practice of making
methods out of perfectly decent enough functions to be able to
comment.

Paul



More information about the Python-list mailing list