Python's theoretically missing core data type
In theory inPython, tuples are for heterogeneous data and lists are for homogeneousdata. Except, well, tuples and lists have 'side effects': tuplesare read-only and lists are not. Which means that if you take therestriction on lists seriously, you do not have a core data type forordered writeable heterogeneous data (and maybe also one for read-onlyhomogeneous data).
(While this is a theory that's probably more honored in the breach thanin practice, I think that
哲學家足球戰馬克思後備80年代西德隊
inside到無比的joke。真係超正。理論足球青年用心聽旁述做中譯吧!
What past problems of mine the collections module solves
The somewhat new collections module has a number of usefulthings that obsolete several of the things I've done by hand in thepast. For my own reference if nothing else, here's more or less whatits solutions obsolete and when each solution was introduced.
defaultdictobsoletes my use ofdict.setdefault(). It was introduced in Python 2.5.namedtupleobsoletes some but not all of my various forms of structures in Python. It wasintroduced in Python 2.6.
The reason namedtuple doesn
接 嘩嘩嘩打到嚟
當我把馬尾束起
二十歲以後,我就一直留著長髮。有時是曲髮,有時是直髮,但我總是讓一溜黑髮披著兩肩,極少把頭髮束起。因為這事,我曾經和Philip激烈地吵過一場。
認識Philip是在我二十歲以後。因此,他從來只認識一個長髮的