Colin J. Williams wrote:
> __len__ is not very special and the
> property len eliminates the redundant parentheses.
tac-tics wrote:
> One might say the current syntax eliminates the redundant dot.
Make "len" an operator, like C's "sizeof", and eliminate the
(hypothetical) dot, parenthesises and a
Colin J. Williams wrote:
> On the other hand, one can argue that, since len is intimately
> associated with an object, it's better treated as an attribute/property
> than to have an unconnected function out in namespace.
"unconnected" ???
--
http://mail.python.org/mailman/listinfo/python-li
tac-tics wrote:
>> __len__ is not very special and the
>> property len eliminates the redundant parentheses.
>
> One might say the current syntax eliminates the redundant dot.
>
touché
On the other hand, one can argue that, since len is intimately
associated with an object, it's better treated
> __len__ is not very special and the
> property len eliminates the redundant parentheses.
One might say the current syntax eliminates the redundant dot.
--
http://mail.python.org/mailman/listinfo/python-list
Colin J. Williams:
> Why not replace the __len__ method with a len property for strings,
> lists, tuples, dictionaries etc. __len__ is not very special and the
> property len eliminates the redundant parentheses.
You mean something like:
>>> "ab".len, [1, 2, 3].len
(2, 3)
In the given page Guido
Giovanni Bajo wrote:
> Thomas Guettler wrote:
>
>> I have read the FAQ to the len function:
>> http://www.python.org/doc/faq/general/#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list
>
> Outdated. You want to read the new FAQ, here:
> http://e
Thomas Guettler wrote:
> I have read the FAQ to the len function:
> http://www.python.org/doc/faq/general/#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list
Outdated. You want to read the new FAQ, here:
http://effbot.org/pyfaq/why-does-python-u
Beliavsky wrote:
> I agree with you -- a.__len__() is ugly compared to len(a) . I am
> surprised that such common idioms as len(a) may be going away.
no need to; the fact that something isn't currently mentioned in a
preliminary Python 3000 PEP doesn't mean that it will be removed.
--
http:/
Beliavsky wrote:
> Thomas Guettler wrote:
> > Hi,
> >
> > The function len() is not mentioned in the Python 3000 PEPs.
> >
> > I suggest that at least lists, tupples, sets, dictionaries and strings
> > get a len() method. I think the len function can stay, removing it
> > would break to much code.
Thomas Guettler wrote:
> Hi,
>
> The function len() is not mentioned in the Python 3000 PEPs.
>
> I suggest that at least lists, tupples, sets, dictionaries and strings
> get a len() method. I think the len function can stay, removing it
> would break to much code. But adding the method, would bu u
Kay Schluehr wrote:
> Pro: Because it makes the API more monotonous and more aligned
> with all other OO languages that exist now and in future. It also
> helps any written and unwritten IDE providing a method by means of
> autocompletion. It ends endless debates with Java/C++/C# etc. and
> newbie
Bjoern Schliessmann schrieb:
> Thomas Guettler wrote:
>
> > I suggest that at least lists, tupples, sets, dictionaries and
> > strings get a len() method.
>
> Why?
Pro: Because it makes the API more monotonous and more aligned with all
other OO languages that exist now and in future. It also help
Thomas Guettler wrote:
> I suggest that at least lists, tupples, sets, dictionaries and
> strings get a len() method.
Why?
> I think the len function can stay, removing it would break to much
> code. But adding the method, would bu usefull.
>
> Yes, I know, that I can call .__len__() but that
Hi,
The function len() is not mentioned in the Python 3000 PEPs.
I suggest that at least lists, tupples, sets, dictionaries and strings
get a len() method. I think the len function can stay, removing it
would break to much code. But adding the method, would bu usefull.
Yes, I know, that I can ca
14 matches
Mail list logo