A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/006420.html below:

[Python-Dev] Python Enhancement Proposals (PEPs)

[Python-Dev] Python Enhancement Proposals (PEPs)M.-A. Lemburg mal@lemburg.com
Thu, 13 Jul 2000 20:44:27 +0200
Fredrik Lundh wrote:
> 
> ?!ng wrote:
> > > Re: open issues: marry([0, 1, 2]) should return [(1,), (2,), (3,)]
> > > Otherwise user-code will probably have to special case more often.
> 
> as in
> 
>     # normal case
>     for (x,) in zip([0, 1, 2]):
>         ...
> 
> vs.
> 
>     # special case
>     for x in zip([0, 1, 2]):
>         ...
> 
> ?

Uhm, why should marry() be defined for a single argument ?
IMHO, this only masks program errors.

BTW:

>>> from mx.Tools import NewBuiltins
>>> marry = tuples
>>> john = lists
>>> marry([0,1,2])
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: sequence elements must be sequences
>>> marry([0,1,2],[3,4,5])
[(0, 3), (1, 4), (2, 5)]
>>> john([0,1,2],[3,4,5])
([0, 3], [1, 4], [2, 5])

... the code is there. I'd say: use it :-)

(Who invented those silly function names ?)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4