Re: c[:]()
On 6/1/07, Warren Stringer <warren@muse.co mwrote:
>
I am not insisting on anything. I use ``c[:]()`` as shorthand way of saying
"c() for c in d where d is a container"
The problem people are having with that is that c[:]() *already* means
something in python, and it doesn't mean "c() for c in d where d is a
container". In today's python c[:]() means "return a slice of object
c, then call that slice". Since most container objects don't have a
__call__() method, it doesn't do what you want, but it is currently
valid syntax.
--
Jerry
On 6/1/07, Warren Stringer <warren@muse.co mwrote:
And that your
insisting on ``c[:]()`` instead of just ``c()`` seems to indicate you want
a change that is quite surprising. It would mean that a slice of a list
returns an other type with the __call__ method implemented.
insisting on ``c[:]()`` instead of just ``c()`` seems to indicate you want
a change that is quite surprising. It would mean that a slice of a list
returns an other type with the __call__ method implemented.
I am not insisting on anything. I use ``c[:]()`` as shorthand way of saying
"c() for c in d where d is a container"
something in python, and it doesn't mean "c() for c in d where d is a
container". In today's python c[:]() means "return a slice of object
c, then call that slice". Since most container objects don't have a
__call__() method, it doesn't do what you want, but it is currently
valid syntax.
--
Jerry
Comment