.split() Qeustion

MRAB python at mrabarnett.plus.com
Thu Aug 15 10:54:14 EDT 2013


On 15/08/2013 15:38, Lele Gaifax wrote:
> wxjmfauth at gmail.com writes:
>
>> As a stupid scientist, I have the habbit to compare
>> things of the same nature with the same units.
>>
>> This *string* containing one *character*
>>
>>>>> sys.getsizeof('a')
>> 26
>>
>> consumes 26 *bytes*.
>
> I'm not an expert in stupid science, and I fail to see the "common"
> nature of the stuff you are comparing. Strings are not characters, and
> neither the latter are bytes.
>
> Anyway, trying to apply the same stupid science, I notice a much more
> amazing fact:
>
>>>> sys.getsizeof(True)
> 24
>
> Does Python really needs twentyfour bytes to store a *single* bit of
> information?? Wow, since by definition a byte contains eight bits,
> there's a factor of 192... what a shame!
>
> :-)
>
>> —————
>>
>> Python seems to consider os.linesep as a
>> str.
>>
>>>>> isinstance(os.linesep, str)
>> True
>
> Yes, I bet in stupid languages that would be either a single character,
> or a tuple of two or more characters, much more usable and compact.
>
>> —————
>>
>> PS A "mole" is not a number.
>
> Oh, nice to know. And OOC, what is a "mole" in your stupid science?
> OTOH, WTF does that matter in current thread and with Python in general?
>
A "mole" is a term from chemistry:

http://en.wikipedia.org/wiki/Mole_%28unit%29

but I have no idea how it relates to Python or even to computers in
general.




More information about the Python-list mailing list