In article ,
James Stroud wrote:
> tal 65% python2.7
> Python 2.7.1 (r271:86832, May 21 2011, 22:52:14)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> py> class C(object):
> ... def __init__(self):
> ... se
James Stroud wrote:
> Peter Otten wrote:
>> James Stroud wrote:
>>> WTF?
>>
>> Put the code into a file, run it -- and be enlightened ;)
>
>
> tal 72% python2.7 eraseme.py
> 1
> 2
> 4
> 8tal 73% cat eraseme.py
> #! /usr/bin/env python
>
> class C:
>def __init__(self):
> self.data = []
Chris Rebert wrote:
On Sat, May 21, 2011 at 11:32 PM, James Stroud wrote:
Chris Rebert wrote:
WTF?
Assuming your question is "Why is 1024 there twice?", the answer is
The question is "Why is 1024 there at all?" It should be 10.
Ah. This is why it's better to be more explicit about what you
Peter Otten wrote:
James Stroud wrote:
WTF?
Put the code into a file, run it -- and be enlightened ;)
Compare the follower to the last.
tal 77% cat eraseme.py
#! /usr/bin/env python
class C:
def __init__(self):
self.data = []
def doit(self, count=[0]):
for c in self.data:
On Sat, May 21, 2011 at 11:32 PM, James Stroud wrote:
> Chris Rebert wrote:
>>>
>>> WTF?
>>
>> Assuming your question is "Why is 1024 there twice?", the answer is
>
> The question is "Why is 1024 there at all?" It should be 10.
Ah. This is why it's better to be more explicit about what your
quest
James Stroud wrote:
Chris Rebert wrote:
WTF?
Assuming your question is "Why is 1024 there twice?", the answer is
The question is "Why is 1024 there at all?" It should be 10.
James
I mean 11, not 10--but you get the point.
James
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
James Stroud wrote:
WTF?
Put the code into a file, run it -- and be enlightened ;)
tal 72% python2.7 eraseme.py
1
2
4
8tal 73% cat eraseme.py
#! /usr/bin/env python
class C:
def __init__(self):
self.data = []
def doit(self, count=0):
for c in self.data:
Chris Rebert wrote:
WTF?
Assuming your question is "Why is 1024 there twice?", the answer is
The question is "Why is 1024 there at all?" It should be 10.
James
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
> tal 65% python2.7
> Python 2.7.1 (r271:86832, May 21 2011, 22:52:14)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> py> class C(object):
> ... def __init__(self):
> ... self.data = []
>
On Sat, May 21, 2011 at 11:02 PM, James Stroud wrote:
> tal 65% python2.7
> Python 2.7.1 (r271:86832, May 21 2011, 22:52:14)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> py> class C(object):
> ... def __init__(
tal 65% python2.7
Python 2.7.1 (r271:86832, May 21 2011, 22:52:14)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
py> class C(object):
... def __init__(self):
... self.data = []
... def doit(self, count=0):
...
11 matches
Mail list logo