[Python-ideas] Vectorization [was Re: Add list.join() please]

James Lu jamtlu at gmail.com
Fri Feb 8 17:11:21 EST 2019


Has anyone thought about my proposal yet? I think because it allows chained function calls to be stored, which is probably something that is a common; if imagine people turning the same series of chained functions into a lambda of its own once it’s used more than once in a program.

Arguably, the lambda syntax is more readable and puts on less visual burden.

Sent from my iPhone

> On Feb 8, 2019, at 3:35 PM, David Mertz <mertz at gnosis.cx> wrote:
> 
>> On Fri, Feb 8, 2019 at 3:17 PM Christopher Barker <pythonchb at gmail.com> wrote:
> 
>> >    vec_seq = Vector(seq)
>> >    (vec_seq * 2).name.upper()
>> >    # ... bunch more stuff
>> >    seq = vec_seq.unwrap()
>> 
>> what type would .unwrap() return?
> 
> The idea—and the current toy implementation/alpha—has .unwrap return whatever type went into the Vector creation.  Might be a tuple, list, set, deque, or it might be an iterator.  It might even be some custom collection that isn't in the standard library.
> 
> But you can also explicitly make a Vector into something else by using that constructor.  Pretty much as I gave example before:
> 
>     set(Vector(a_list))             # Get a set
>     Vector(a_list)).unwrap()    # Get a list (without needing to know type to call .unwrap())
>  
> -- 
> Keeping medicines from the bloodstreams of the sick; food 
> from the bellies of the hungry; books from the hands of the 
> uneducated; technology from the underdeveloped; and putting 
> advocates of freedom in prisons.  Intellectual property is
> to the 21st century what the slave trade was to the 16th.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190208/7e0dc540/attachment-0001.html>


More information about the Python-ideas mailing list