[Python-3000] A few small py3k wishes

Michael P. Soulier msoulier at digitaltorque.ca
Tue Apr 4 14:52:47 CEST 2006


On 04/04/06 Gareth McCaughan said:

> > It's a minor thing, but it'd be nice to make a method alias for append() on
> > mutable sequences called push(), to go with pop(). 
> 
> That would confuse anyone used to Lisp, where after
> 
>     (defvar foo (list 1 2 3 4))
>     (puch 99 foo)
> 
> the value of FOO is (99 1 2 3 4) rather than (1 2 3 4 99).
> I take no stand on how much not confusing Lispers matters
> to Python 3k.

It would ease transition from Perl, and be consistent in the method naming. If
one is going to use a method obviously taken from the stack ADT, having a
method normally called push() would be less confusing. I know that I found it
so, having both used stacks and Perl. 

I can make a list subclass obviously, but I've always found append() and pop()
one of those arrangements that just makes new Python programmers say, huh?

Mike

-- 
Michael P. Soulier <msoulier at digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20060404/8180123a/attachment.pgp 


More information about the Python-3000 mailing list