What is Python's answer to Perl 6?

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Sat Oct 30 10:02:43 EDT 2004


Jonathan Ellis wrote:
> A.M. Kuchling wrote:
>> The list of features for Python 3000 is described in PEP 3000,
>> appropriately enough:
>>
>> http://www.python.org/peps/pep-3000.html
>>
>> Most of the suggested changes remove redundancy, such as removing
>> now-unneeded built-in functions and language features.
> 
> I'm sure this has been brought up before, but a quick google search
> didn't find anything on moving [has|get|set]attr into attributes of
> object.  Why wouldn't this be considered a Good Thing?  Just because
> Ruby people would like it? :)

You can take this step even further:

The builtin functions (that aren't doomed for py3k) can be classified in
those groups:

A. Constructors for built-in types

basestring, bool, complex, dict, file, float, int, list, long, object,
str, slice, tuple, type

These cannot be made attributes of some object.

B. Functions that can be attributed to some class or module

abs, divmod, round, pow -> math

ord -> str
In consequence: [uni]chr -> int
hex, oct -> int

super, *attr, isinstance, issubclass -> object

hash -> sys?

C. Functions that could be made attributes of lists/sequences

max, min, len, enumerate, sum

But that would require to implement them for all sequence types or
implement a common basetype 'seq'.

D. Other functions I cannot attribute to a class

eval
globals, locals, vars
iter
property
classmethod, staticmethod
cmp
[x]range
repr
__import__

Reinhold

-- 
[Windows ist wie] die Bahn: Man muss sich um nichts kuemmern, zahlt fuer
jede Kleinigkeit einen Aufpreis, der Service ist mies, Fremde koennen
jederzeit einsteigen, es ist unflexibel und zu allen anderen Verkehrs-
mitteln inkompatibel.               -- Florian Diesch in dcoulm



More information about the Python-list mailing list