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 sin
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
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 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
On Apr 3, 8:48 am, Steven D'Aprano 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 don't post things like li
On Apr 3, 11:48 pm, Tim Wintle 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 of any consequence
On 4 Apr, 04:19, Steven D'Aprano 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 surprised that such a topic h
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 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
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 surprise
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
--
http://mail.python.org/mailman/listi
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’
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
‘list’
Mel 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
deprecated, not forbidden.
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 al
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
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
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’ conf
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 wha
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 ca
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.
--
http://mail.python.org/mailman/li
Steven D'Aprano 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 still think that alist.clear()
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:
On Fri, 03 Apr 2009 02:40:08 +0100, Zac Burns 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 newsgroup.
I see no r
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 (Digi
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 course
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
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
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 --
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 *ask*
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. Co
Quoting Esmail :
> 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 you learn it,
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 .writeline
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?)?
--
http://mail.python.org/
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
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
36 matches
Mail list logo