On Fri, Feb 8, 2019 at 3:17 PM Christopher Barker <[email protected]>
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
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/