Re: [Python-Dev] List vs Tuple / Homogeneous vs Heterogeneous / Mutable vs Immutable

2014-04-22 Thread Leandro Pereira de Lima e Silva
> > In teaching Python, I find that analogs to other languages are helpful > in explaining Python even if a person doesn't know the other language. > sorted(set(open(somefile))) > is like: > cat somefile | sort | uniq # different algorithm, same outcome > or: >SELECT DISTINCT line

Re: [Python-Dev] List vs Tuple / Homogeneous vs Heterogeneous / Mutable vs Immutable

2014-04-22 Thread Leandro Pereira de Lima e Silva
That's rather vague, isn't it? "Usually contains" isn't nearly as prescriptive as "should be used for". A co-worker with whom I discussed the matter these days also argued that a language shouldn't prescribe as one uses a data structure, although I do think conventions in semantics helps maintaina

Re: [Python-Dev] List vs Tuple / Homogeneous vs Heterogeneous / Mutable vs Immutable

2014-04-22 Thread Stephen J. Turnbull
Leandro Pereira de Lima e Silva writes: >> In teaching Python, I find that analogs to other languages are >> helpful in explaining Python even if a person doesn't know the other >> language. >>    sorted(set(open(somefile))) >> is like: >>    cat somefile | sort | uniq       # different al