Perl is worse! (was: Python is Wierd!)
Ben Wolfson
rumjuggler at cryptarchy.org
Fri Jul 28 05:08:31 EDT 2000
On Fri, 28 Jul 2000 07:57:12 GMT, grey at despair.rpglink.com (Steve Lamb)
wrote:
>On Fri, 28 Jul 2000 05:56:07 GMT, Grant Edwards <nobody at nowhere.nohow> wrote:
>>> foo is not ['a'].
>
>>It is when I try it...
>
> ...
>
>>> It took a single element and made it a list.
>
> Right, which is what I said here, who knows how the not got there.
>
>>No, it took a sequence containing a single element and turned it into a list
>>containing a single element. list() only works on sequences. 'a' is a
>>sequence of length 1.
>
> That is what I said. It took a single element and made it a list with a
>single element.
>
>>>So we now know that a single element has a sequence.
>
>>Not in the general case.
>
> Not in this language. In general, yes. Both of these are a single
>element sequence. 1. a. Because Python doesn't think so doesn't make it any
>less so.
You don't even know that a single element has a sequence. You just know
that a sequence with only one element has a sequence, which is no great
revelation, I think.
>>No, 1 is not a sequence. 1 is an integer. [1] is a sequence. (1) is a
>>sequence.
>
> 1 is a single element sequence, regardless of any arbitrary type assigned
>to it.
How is assigning what is rather clearly a number the type "number"
arbitrary?
If one is a single-element sequence, why does one plus one equal two?
Sequence addition should be equivalent to concatenation.
And if one is a sequence, what's one hundred and eleven? A three-element
sequence, or a one-element? I mean, is 111[0] 111, or 1?
>>str() and list() are not inverse operations. They are neither claimed nor
>>intended to be.
>
> Nor did I claim they were. That's three people who didn't read the last
>sentence of that paragraph.
I read it, I just didn't see the point in the entire paragraph being there
if you weren't making some implicit criticism of the current system.
--
Barnabas T. Rumjuggler
True, Father Time has long and cruelly sodomized me with the splintered
haft of his great scythe, but I shall out-live the God-damned lot of you!
-- T. Herman Zweibel
More information about the Python-list
mailing list