<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I think it should follow the pre-existing behaviour of list, set, tuple, <br>
etc.<br>
<br>
>>> Vector("hello")<br>
<Vector of ['h', 'e', 'l', 'l', 'o']><br></blockquote><div><br></div><div>I try to keep the underlying datatype of the wrapped collection as much as possible. Casting a string to a list changes that.</div><div><br></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div class="gmail_quote"><div><div><font face="monospace, monospace">>>> Vector(d)</font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace"><Vector of ['Monday', 'Tuesday', 'Wednesday']></font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace">>>> Vector(tuple(d))</font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace"><Vector of ('Monday', 'Tuesday', 'Wednesday')></font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace">>>> Vector(set(d))</font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace"><Vector of {'Wednesday', 'Monday', 'Tuesday'}></font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace">>>> from collections import deque</font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace">>>> Vector(deque(d))</font></div></div></div></div><div><div class="gmail_quote"><div><div><font face="monospace, monospace"><Vector of deque(['Monday', 'Tuesday', 'Wednesday'])></font></div></div></div></div></blockquote><div dir="ltr"><div class="gmail_quote"><div> </div><div>Strings are already a Collection, there is not firm need cast them to a list to live inside a Vector. I like the idea of maintaining the original type if someone wants it back later (possibly after transformations of the values).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Why is it pointless for a vector, but not for a list?<br></blockquote><div><br></div><div>I guess it really isn't. I was thinking of just .upper() and .lower() where upper/lower-casing each individual letter is the same as doing so to the whole string. But for .replace() or .count() or .title() or .swapcase() the meaning is very different if it is letter-at-a-time.</div><div><br></div><div>I guess a string gets unstringified pretty quickly no matter what though. E.g. this seems like right behavior once we transform something:</div><div><br></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div class="gmail_quote"><div><div><font face="monospace, monospace">>>> vstr = Vector('Monday')</font></div></div></div></div></div><div><div><div class="gmail_quote"><div><font face="monospace, monospace">>>> vstr</font></div></div></div></div><div><div><div class="gmail_quote"><div><font face="monospace, monospace"><Vector of 'Monday'></font></div></div></div></div><div><div><div class="gmail_quote"><div><font face="monospace, monospace">>>> vstr.upper()</font></div></div></div></div><div><div><div class="gmail_quote"><div><font face="monospace, monospace"><Vector of "['M', 'O', 'N', 'D', 'A', 'Y']"></font></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div><br></div><div>I dunno... I suppose I *could* do `self._it = "".join(self._it)` whenever I do a transform on a string to keep the underlying iterable as a string. But the point of a Vector really is sequences of strings not sequences of characters.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons. Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div></div></div></div>