On Sat, 2009-04-04 at 15:36 -0500, Robert Kern wrote:
On 2009-04-04 12:07, Tim Wintle wrote:
(I didn't expect such strong responses btw!)
You are proposing the removal of a general, orthogonal feature (and
breaking
code in consequence!) just because of a new syntax for a single special
On 2009-04-03 23:48, Tim Wintle wrote:
On Fri, 2009-04-03 at 18:27 -0500, Robert Kern wrote:
agreed. If .clear was to be added then really assignments to slices
should be entirely removed.
Please tell me you are joking.
Well I'm not joking as such.
I've noticed that python-ideas seems to be
On 4 Apr, 04:19, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
On Fri, 03 Apr 2009 18:52:52 -0700, Giampaolo Rodola' wrote:
If there should be one-- and preferably only one --obvious way to do
it then my_list.clear() is more obvious than del my_list[:]. Honestly
I'm a little
On Apr 3, 11:48 pm, Tim Wintle tim.win...@teamrubber.com wrote:
del mylist[:]
* or *
mylist[:] = []
* or *
mylist = []
which, although semantically similar are different as far as the
interpreter are concerned (since two of them create a new list):
Only the last item creates a new list
On Apr 3, 8:48 am, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
On Fri, 03 Apr 2009 08:23:22 -0700, Zamnedix wrote:
On Apr 2, 3:25 pm, online.serv...@ymail.com wrote:
python's list needs a thing list.clear() like c# arraylist and
python needs a writeline() method
Please
On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote:
Let's be clear: python-ideas seems positive on the idea of adding a .clear()
method. *Completely removing* slice assignment has not been broached there.
Yup, sorry - I did mean to refer to the initial suggestion, rather than
my comments
Tim Wintle schrieb:
On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote:
Let's be clear: python-ideas seems positive on the idea of adding a .clear()
method. *Completely removing* slice assignment has not been broached there.
Yup, sorry - I did mean to refer to the initial suggestion, rather
On 2009-04-04 12:07, Tim Wintle wrote:
On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote:
Let's be clear: python-ideas seems positive on the idea of adding a .clear()
method. *Completely removing* slice assignment has not been broached there.
Yup, sorry - I did mean to refer to the initial
On Apr 2, 3:25 pm, online.serv...@ymail.com wrote:
python's list needs a thing list.clear() like c# arraylist
and
python needs a writeline() method
Please don't post things like list before you do any research.
You don't know what you are talking about.
--
Ben Finney wrote:
I think it would also be better to have One (and prefereably Only One)
Obvious Way To Do It. That obvious way, for those who work with
Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have
‘list’ conform with this also.
Does that mean a one-off special case
On Fri, 03 Apr 2009 08:23:22 -0700, Zamnedix wrote:
On Apr 2, 3:25 pm, online.serv...@ymail.com wrote:
python's list needs a thing list.clear() like c# arraylist and
python needs a writeline() method
Please don't post things like list before you do any research. You don't
know what you
On Fri, 03 Apr 2009 11:41:10 -0400, Mel wrote:
Ben Finney wrote:
I think it would also be better to have One (and prefereably Only One)
Obvious Way To Do It. That obvious way, for those who work with
Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have
‘list’ conform with
Steven D'Aprano wrote:
On Fri, 03 Apr 2009 11:41:10 -0400, Mel wrote:
Ben Finney wrote:
I think it would also be better to have One (and prefereably Only One)
Obvious Way To Do It. That obvious way, for those who work with
Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to
On Fri, 2009-04-03 at 13:12 -0400, Mel wrote:
I think it would also be better to have One (and prefereably Only One)
Obvious Way To Do It. That obvious way, for those who work with
Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have
‘list’ conform with this also.
Tim Wintle wrote:
On Fri, 2009-04-03 at 13:12 -0400, Mel wrote:
I think it would also be better to have One (and prefereably Only One)
Obvious Way To Do It. That obvious way, for those who work with
Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have
‘list’ conform with this
Mel mwil...@the-wire.com writes:
Well, if list.clear were truly and strictly to be the only way to
clear the contents of a list
Who ever suggested that?
Note that the “OOW” in OOWTDI does *not* mean “Only One Way”. It
means “One Obvious Way”. Having other Ways To Do It is only mildly
On 2009-04-03 16:42, Tim Wintle wrote:
On Fri, 2009-04-03 at 13:12 -0400, Mel wrote:
I think it would also be better to have One (and prefereably Only One)
Obvious Way To Do It. That obvious way, for those who work with
Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have
On Fri, 03 Apr 2009 22:42:33 +0100, Tim Wintle wrote:
On Fri, 2009-04-03 at 13:12 -0400, Mel wrote:
I think it would also be better to have One (and prefereably Only
One) Obvious Way To Do It. That obvious way, for those who work
with Python's ‘set’ and ‘dict’, is a ‘clear’ method. It
If there should be one-- and preferably only one --obvious way to do
it then my_list.clear() is more obvious than del my_list[:].
Honestly I'm a little surprised that such a topic hasn't been raised
before.
--- Giampaolo
http://code.google.com/p/pyftpdlib
--
On Fri, 03 Apr 2009 18:52:52 -0700, Giampaolo Rodola' wrote:
If there should be one-- and preferably only one --obvious way to do
it then my_list.clear() is more obvious than del my_list[:]. Honestly
I'm a little surprised that such a topic hasn't been raised before.
I'm a little surprised
On Fri, 2009-04-03 at 18:27 -0500, Robert Kern wrote:
agreed. If .clear was to be added then really assignments to slices
should be entirely removed.
Please tell me you are joking.
Well I'm not joking as such.
I've noticed that python-ideas seems to be positive on the idea, and has
a
python's list needs a thing list.clear() like c# arraylist
and
python needs a writeline() method
--
http://mail.python.org/mailman/listinfo/python-list
online.serv...@ymail.com schrieb:
python's list needs a thing list.clear() like c# arraylist
and
some_list[:] = []
python needs a writeline() method
print()
Diez
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
online.serv...@ymail.com schrieb:
python's list needs a thing list.clear() like c# arraylist
and
some_list[:] = []
I agree that this is nice and clear, but as a relative newbie
wouldn't
some_list = []
be also acceptable (and pythonic?)?
--
Quoting online.serv...@ymail.com:
python's list needs a thing list.clear() like c# arraylist
It has:
l[:] = []
python needs a writeline() method
Now, that could be useful, a writeline method that knew the EOL convention for
the OS and were not as deceiving as the current .writelines().
Quoting Esmail ebo...@hotmail.com:
Diez B. Roggisch wrote:
some_list[:] = []
I agree that this is nice and clear,
Not very intuitive, though, until you learn the syntax.
(but, slice accessing and slice assignment are among the first few things one
learns about python anyway, and once
Esmail wrote:
Diez B. Roggisch wrote:
online.serv...@ymail.com schrieb:
python's list needs a thing list.clear() like c# arraylist
and
some_list[:] = []
I agree that this is nice and clear, but as a relative newbie
wouldn't
some_list = []
This is different -- it creates a new list.
online.serv...@ymail.com wrote:
python's list needs a thing list.clear() like c# arraylist
and
python needs a writeline() method
--
http://mail.python.org/mailman/listinfo/python-list
(While you are correct that Python needs these things, a better
attitude, as a newbie, would be to
Emile van Sebille wrote:
Esmail wrote:
Diez B. Roggisch wrote:
online.serv...@ymail.com schrieb:
python's list needs a thing list.clear() like c# arraylist
and
some_list[:] = []
I agree that this is nice and clear, but as a relative newbie
wouldn't
some_list = []
This is different --
Is it really worth it to not implement list.clear and answer this
question over and over again?
I see no reason that a list shouldn't have a .clear method.
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games
On Thu, Apr 2, 2009 at 5:32 PM, Esmail
Diez B. Roggisch wrote:
online.serv...@ymail.com schrieb:
python's list needs a thing list.clear() like c# arraylist
and
some_list[:] = []
Or
del some_list[:]
--
http://mail.python.org/mailman/listinfo/python-list
Zac Burns wrote:
Is it really worth it to not implement list.clear and answer this
question over and over again?
I see no reason that a list shouldn't have a .clear method.
Does dict have a .clear method? Yes.
Does set have a .clear method? Yes.
Does list have a .clear method? No.
Of
On Thursday 02 April 2009 22:40:08 Zac Burns wrote:
Is it really worth it to not implement list.clear and answer this
question over and over again?
I see no reason that a list shouldn't have a .clear method.
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital
On Fri, 03 Apr 2009 02:40:08 +0100, Zac Burns zac...@gmail.com wrote:
Is it really worth it to not implement list.clear and answer this
question over and over again?
For some value of over and over again that allows this to be the
first time I've seen it several months of reading the
On Thu, 02 Apr 2009 18:40:08 -0700, Zac Burns wrote:
Is it really worth it to not implement list.clear and answer this
question over and over again?
I see no reason that a list shouldn't have a .clear method.
The usual answer to that is that there's already two ways of clearing a
list:
Steven D'Aprano st...@remove-this-cybersource.com.au writes:
The usual answer to that is that there's already two ways of clearing a
list:
del alist[:]
alist[:] = []
and we don't need a third way. Dicts and sets need a clear() method,
because there's no equivalent to slicing.
I
36 matches
Mail list logo