On Sep 17, 2018 9:31 AM, "YnIk" wrote:
>
> Dear Python,
> Hello. This is an email concerning about my Python program(3.7.0). It
keeps printing out stuff that’s too fast to read. If I try to write code,
it just keeps on going. I have tried Ctrl+C, but even that’s not working. I
searched through all
YnIk wrote:
> Dear Python,
> Hello. This is an email concerning about my Python program(3.7.0). It
> keeps printing out stuff that’s too fast to read. If I try to write code,
> it just keeps on going. I have tried Ctrl+C, but even that’s not working.
> I searched through all my flies and can’t fin
Dear Python,
Hello. This is an email concerning about my Python program(3.7.0). It keeps
printing out stuff that’s too fast to read. If I try to write code, it just
keeps on going. I have tried Ctrl+C, but even that’s not working. I searched
through all my flies and can’t find one error that wou
On 16/10/2017 18:53, Stefan Ram wrote:
Ian Kelly writes:
I honestly can't remember the last time I programmed an endless loop,
and I also can't remember the last time I used a while loop.
Those two things are probably related.
My Python installation has a "Lib" direct
On Sat, Oct 14, 2017 at 8:10 PM, Stefan Ram wrote:
> I made an error I made a thousand times before.
>
> I had programmed an endless loop.
>
> But never did I see before so clear why it's called
> an endless loop. (Tested in IDLE.)
>
> from turtle import
On Mon, 16 Oct 2017 01:38 am, Ned Batchelder wrote:
> We've covered this before. A challenge for the group: let's not create
> yet another 100-reply thread rehashing the design of Python looping...
> Please? :)
Certainly!
So... who thinks that Python should implement tail recursion optimization
On 10/15/17 9:59 AM, bartc wrote:
On 15/10/2017 12:20, Chris Angelico wrote:
On Sun, Oct 15, 2017 at 9:15 PM, bartc wrote:
I assume you're talking about the while-loop (because on my machine, it
hangs just using 'from turtle...' or 'import turtle').
(Machine was screwed up I think, as I ha
On 15/10/2017 12:20, Chris Angelico wrote:
On Sun, Oct 15, 2017 at 9:15 PM, bartc wrote:
I assume you're talking about the while-loop (because on my machine, it
hangs just using 'from turtle...' or 'import turtle').
(Machine was screwed up I think, as I had to restart it shortly after
for
On Sun, Oct 15, 2017 at 9:15 PM, bartc wrote:
> On 15/10/2017 03:10, Stefan Ram wrote:
>>
>>I made an error I made a thousand times before.
>>
>>I had programmed an endless loop.
>>
>>But never did I see before so clear why it's c
On 2017-10-15 10:15, bartc wrote:
> On 15/10/2017 03:10, Stefan Ram wrote:
>>I made an error I made a thousand times before.
>>
>> I had programmed an endless loop.
>>
>>But never did I see before so clear why it's called
>>an endles
On 15/10/2017 03:10, Stefan Ram wrote:
I made an error I made a thousand times before.
I had programmed an endless loop.
But never did I see before so clear why it's called
an endless loop. (Tested in IDLE.)
from turtle import *
reset(); reset(); shape( 'turtle'
On Sun, 15 Oct 2017 01:43 pm, Dennis Lee Bieber wrote:
> On 15 Oct 2017 02:10:15 GMT, r...@zedat.fu-berlin.de (Stefan Ram) declaimed
> the following:
[...]
>>def poly( n, length ):
>>i = 0
>>while i < n:
>>forward( length )
>>left( 360/n )
>>
>
> A clear example of why a p
. what I get is S p a m which seems logical to me since the
> > loop stops after the 4th character.
>
> I think you're mistaking the cause and effect here, see below.
>
> > class stepper:
> > def __getitem__(self, i):
> > return i
>
>
ps after the 4th character.
I think you're mistaking the cause and effect here, see below.
> class stepper:
> def __getitem__(self, i):
> return i
>
> X=stepper()
> X.data="Spam"
> for item in X:
> print item,
>
> ... what I get is an endles
On Jan 2, 3:50 pm, vsoler wrote:
> My question is: why does this second script not stop after printing
> number 3? what made the first one stop while the second one will not?
First one will raise IndexError when string is over, second one won't.
--
http://mail.python.org/mailman/listinfo/pytho
p a m which seems logical to me since the
loop stops after the 4th character.
However if I run
class stepper:
def __getitem__(self, i):
return i
X=stepper()
X.data="Spam"
for item in X:
print item,
... what I get is an endless loop, starting at zero:0 1 2 3 4 5
On 2008-05-14, Tim Roberts <[EMAIL PROTECTED]> wrote:
> globalrev <[EMAIL PROTECTED]> wrote:
>
>>and when the program gets killed because out of memory all this
>>will be deleted from the memory?
>
> Yes. When a process is killed, all of the memory it was using
> is released.
>
>>so there is no wa
Tim Roberts a écrit :
globalrev <[EMAIL PROTECTED]> wrote:
and when the program get skiled because out of memory all this will be
deleted from the memory?
Yes. When a process is killed, all of the memory it was using is released.
so there is no way that you can, by accident, fill your whole
globalrev <[EMAIL PROTECTED]> wrote:
>
>and when the program get skiled because out of memory all this will be
>deleted from the memory?
Yes. When a process is killed, all of the memory it was using is released.
>so there is no way that you can, by accident, fill your whole
>harddrive and make i
En Tue, 13 May 2008 15:18:31 -0300, globalrev <[EMAIL PROTECTED]>
escribió:
On 13 Maj, 18:59, Filip Štědronský <[EMAIL PROTECTED]> wrote:
On Út, kvě 13, 2008 at 06:49:33 +0200, globalrev wrote:
> if i do something like
> while 1:
> print "x"
> will the program ever stop because it runs ou
On 13 Maj, 18:59, Filip Štědronský <[EMAIL PROTECTED]> wrote:
> On Út, kvě 13, 2008 at 06:49:33 +0200, globalrev wrote:
>
> > if i do something like
> > while 1:
> > print "x"
>
> > will the program ever stop because it runs out of memory?
>
> No, there is no reason to run out of memory. This w
On May 13, 11:59 am, Filip Štědronský <[EMAIL PROTECTED]> wrote:
> On Út, kvě 13, 2008 at 06:49:33 +0200, globalrev wrote:
>
> > if i do something like
> > while 1:
> > print "x"
>
> > will the program ever stop because it runs out of memory?
>
> No, there is no reason to run out of memory. Thi
On Út, kvě 13, 2008 at 06:49:33 +0200, globalrev wrote:
> if i do something like
> while 1:
> print "x"
>
> will the program ever stop because it runs out of memory?
No, there is no reason to run out of memory. This will simply
make an everlasting x-printer and there is no need to store
anyth
if i do something like
while 1:
print "x"
will the program ever stop because it runs out of memory? or is the
print x never stored somewhere?
if u do soemhting like add element to a list it has an upper nbr of
elements right? if though huge...
does windows or any other OS have some proces that
[Claudio Grondi]
>> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit
(Intel)] on win32 - IDLE 1.1.2
>> >>> a=[]
>> >>> a.append(a)
>> >>> b=[]
>> >>> b.append(b)
>> >>> a==b
>>
>> Traceback (most recent call last):
>>File "", line 1, in -toplevel-
>> a==b
>> RuntimeError:
On Sat, 21 Jan 2006 01:12:28 +0100, Claudio Grondi wrote:
> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
> win32 - IDLE 1.1.2
> >>> a=[]
> >>> a.append(a)
> >>> b=[]
> >>> b.append(b)
> >>> a==b
>
> Traceback (most recent call last):
>File "", line 1, in -top
simple
>> if a==b: print 'a==b'
>>statement results in an endless loop.
>
>
> Why would you want to?
>
>
>>To my knowledge this is not possible to achieve in C, but is probably
>>achievable in Python.
>
>
> I doubt it.
>
> The closes
ent results in an endless loop.
Why would you want to?
> To my knowledge this is not possible to achieve in C, but is probably
> achievable in Python.
I doubt it.
The closest I can think of is something like this:
a = []
a.append(a)
b = []
b.append(b)
a == b
which I'm told us
Magnus Lycka wrote:
> Claudio Grondi wrote:
>
>> You seem here to try to give a definition of the term 'value' for
>> Python. If I understand it right, the definition of the term can't be
>> generally given for many reasons. It depends at least on type and in
>> advanced usage it can be arbitra
Claudio Grondi wrote:
> You seem here to try to give a definition of the term 'value' for
> Python. If I understand it right, the definition of the term can't be
> generally given for many reasons. It depends at least on type and in
> advanced usage it can be arbitrary defined or changed.
> That
On 2006-01-19, Terry Hancock <[EMAIL PROTECTED]> wrote:
>>> given that it's trivial to create fork bombs and memory
>>> monsters in all those languages, I think you might need
>>> to define the term "real OS".
>>>
>>> (or do you run all your programs in a virtual sandbox ?)
>>
>> I guess I never
Claudio Grondi wrote:
> Dennis Lee Bieber wrote:
>
>>On Thu, 19 Jan 2006 17:25:38 +0100, Claudio Grondi
>><[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>>
>>
>>
>>>Any hints towards enlightenment what this from the geometry known term
>>>'ellipsis' mean in Python? Googling show
On Thu, 19 Jan 2006 19:30:18 +0100
Claudio Grondi <[EMAIL PROTECTED]> wrote:
> Dennis Lee Bieber wrote:
> > On Thu, 19 Jan 2006 17:25:38 +0100, Claudio Grondi
> > <[EMAIL PROTECTED]> declaimed the following in
> > comp.lang.python:
> As shown just above in this thread the code:
> >>> a = [1]
>
On Thu, 19 Jan 2006 17:42:40 -
Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2006-01-19, Fredrik Lundh <[EMAIL PROTECTED]>
> wrote:
>
> >> > It is precisely this power that makes C such a
> >dangerous > > language to program in -- it's what makes
> >it so easy to crash > > your program, any o
In article <[EMAIL PROTECTED]>,
Claudio Grondi <[EMAIL PROTECTED]> wrote:
> Donn Cave wrote:
...
> > exactly, "value". The realization you just had, that is so valid,
> > is that it is futile to talk about value, per se. Changing the
> > word you use will do nothing to improve this.
> That's ri
Donn Cave wrote:
> In article <[EMAIL PROTECTED]>,
> Claudio Grondi <[EMAIL PROTECTED]> wrote:
>
>
>>You seem here to try to give a definition of the term 'value' for
>>Python. If I understand it right, the definition of the term can't be
>>generally given for many reasons. It depends at l
Dennis Lee Bieber wrote:
> On Thu, 19 Jan 2006 17:25:38 +0100, Claudio Grondi
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>
>>Any hints towards enlightenment what this from the geometry known term
>>'ellipsis' mean in Python? Googling shows, that I am not the first who
On 2006-01-19, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>> > It is precisely this power that makes C such a dangerous
>> > language to program in -- it's what makes it so easy to crash
>> > your program, any other program running on the same machine,
>>
>> Nonsense. Under Windows 3.0 that may be
Grant Edwards wrote:
> > It is precisely this power that makes C such a dangerous
> > language to program in -- it's what makes it so easy to crash
> > your program, any other program running on the same machine,
>
> Nonsense. Under Windows 3.0 that may be true, but on any real
> OS, you can't "c
Claudio Grondi wrote:
> The Python tutorial '3.2 The standard type hierarchy' says:
> """
> Ellipsis: This type has a single value. There is a single object with
> this value. This object is accessed through the built-in name Ellipsis.
> It is used to indicate the presence of the "..." syntax i
On 2006-01-19, Terry Hancock <[EMAIL PROTECTED]> wrote:
> It is precisely this power that makes C such a dangerous
> language to program in -- it's what makes it so easy to crash
> your program, any other program running on the same machine,
Nonsense. Under Windows 3.0 that may be true, but on a
In article <[EMAIL PROTECTED]>,
Claudio Grondi <[EMAIL PROTECTED]> wrote:
...
> You seem here to try to give a definition of the term 'value' for
> Python. If I understand it right, the definition of the term can't be
> generally given for many reasons. It depends at least on type and in
> adva
On Thu, 19 Jan 2006 14:22:34 +0100
Claudio Grondi <[EMAIL PROTECTED]> wrote:
> this is still _not_ what I am looking for, because Python
> detects here the problem and throws an exception. What I
> am looking for is an endless loop where there is no any
> response from Python a
On Wed, 18 Jan 2006 17:10:09 +0100
Claudio Grondi <[EMAIL PROTECTED]> wrote:
> or when the objects being members of the list redefine
> __eq__ so, that no matter how different they are, the
> lists always compare True.
If those objects have redefined __eq__ so that they are all
equal in value to
Steve Holden wrote:
> Claudio Grondi wrote:
>
>> Steven D'Aprano wrote:
>
> [...]
>
The higher level of abstraction/indirection in Python results in making
the concepts of 'value', 'having a value' or 'comparing values'
useless,
where it helps in C to express the difference
On Thu, 19 Jan 2006 10:25:12 +0100
Claudio Grondi <[EMAIL PROTECTED]> wrote:
> From the one side I am glad that Python cares about
> memory allocation
> for me, but on the other side I have trouble to accept,
> that I have no direct access to the memory area where
> data are stored in order to
On Thu, 19 Jan 2006 08:06:50 +0100 in comp.lang.python, "Fredrik
Lundh" <[EMAIL PROTECTED]> wrote:
>Dave Hansen wrote:
>
[EMAIL PROTECTED] wrote]
>> >Fuzzyman wrote:
[...]
>> >> In this case :
>> >>
>> >> a = ['some string']
>> >> b = ['somestring']
>> >> a == b
>> >> False (probably)
>> >That d
t True, the Python engine is definitely broken.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Why are you comparing C behaviour to Python behaviour? What is the
>>>>> point of the discussion?
>>>
Fuzzyman wrote:
> (If I understand correctly...)
>
> The reason he is looking for it, is in order to assert that Python
> 'comparison' is broken.
a bit this way, but why formulate it with such a negative touch?
Lets understand it more as looking for a way to get a deep understanding
of the concep
append() goes not that far to try to
> generate the actual list (getting trapped in the endless loop) and only
> lets the second list element point to the object with the list itself.
I think you've got this.
a = []
Here a is a reference to a list object.
a.append(a)
As mentioend
t;>>>Why are you comparing C behaviour to Python behaviour? What is the
>>>>point of the discussion?
>>>
>>>
>>>
>>>The point is to find a way to create in Python two indentifiers a and
>>>b without manipulating any of the __eq__ and to __
rint "True"
>>>> _does not_ print True, the Python engine is definitely broken.
>>>
>>>
>>>
>>>
>>> Why are you comparing C behaviour to Python behaviour? What is the
>>> point of the discussion?
>>
>>
>&g
(If I understand correctly...)
The reason he is looking for it, is in order to assert that Python
'comparison' is broken.
Part of this is because of his assertation that the term 'value' has no
meaning in Python.
He bases this on the fact that Java and C define 'value' to mean the
pointer when t
Claudio Grondi wrote:
> Steven D'Aprano wrote:
[...]
>>>The higher level of abstraction/indirection in Python results in making
>>>the concepts of 'value', 'having a value' or 'comparing values' useless,
>>>where it helps in C to express the difference between address and
>>>content at that address
en.
>>
>>
>>
>>Why are you comparing C behaviour to Python behaviour? What is the point
>>of the discussion?
>
>
> The point is to find a way to create in Python two indentifiers a and b
> without manipulating any of the __eq__ and to __eq__ rel
Steven D'Aprano wrote:
> On Wed, 18 Jan 2006 15:29:24 +0100, Claudio Grondi wrote:
>
>
>>The problem here is, that I mean, that in Python it makes no sense to
>>talk about a value of an object, because it leads to weird things when
>>trying to give a definition what a value of an object is.
>
thon behaviour? What is the point
> of the discussion?
The point is to find a way to create in Python two indentifiers a and b
without manipulating any of the __eq__ and to __eq__ related functions
in a way, that the simple
if a==b: print 'a==b'
statement results in an endl
Claudio Grondi wrote:
> Exactly this is what Python does under the hood when writing
> a = "some string"
> b = "some string"
> where a and b are actually, in terms of C, pointer to Python object data
> structures which provide strings as arrays where it is possible to say
> a[0], but ... if here
Fredrik Lundh wrote:
> Dave Hansen wrote:
>
>
>>>Fuzzyman wrote:
>>>
I'm not familiar with the C basic datatypes - I assume it has an array
or list like object.
Would it contain a sequence of poitners to the members ? In which case
they would only be equal if the pointers are
Dave Hansen wrote:
> >Fuzzyman wrote:
> >> I'm not familiar with the C basic datatypes - I assume it has an array
> >> or list like object.
> >>
> >> Would it contain a sequence of poitners to the members ? In which case
> >> they would only be equal if the pointers are the same.
> >>
> >> In this
In article <[EMAIL PROTECTED]>,
Claudio Grondi <[EMAIL PROTECTED]> wrote:
...
> It is probably true, that it doesn't much matter when writing Python
> code when one do not understand how Python works internally. The rare
> practical cases of getting into trouble because of lack of such
> unders
On Wed, 18 Jan 2006 15:29:24 +0100, Claudio Grondi wrote:
> The problem here is, that I mean, that in Python it makes no sense to
> talk about a value of an object, because it leads to weird things when
> trying to give a definition what a value of an object is.
Python object: 1
The value of th
On 18 Jan 2006 08:41:00 -0800 in comp.lang.python, [EMAIL PROTECTED]
wrote:
>
>Fuzzyman wrote:
>> I'm not familiar with the C basic datatypes - I assume it has an array
>> or list like object.
>>
>> Would it contain a sequence of poitners to the members ? In which case
>> they would only be equal
On Wed, 18 Jan 2006 17:03:23 +0100 in comp.lang.python, Claudio Grondi
<[EMAIL PROTECTED]> wrote:
[...]
>
> >>> a = 1L
> >>> b = 1L
> >>> a is b
>False
>
>Python fails to reuse the long integer object. It would be interesting
>to know why, because it seems to be strange, that in case of integers
Claudio Grondi wrote:
>
>
>
> Subject:
> Re: Can a simple a==b 'hang' in and endless loop?
> From:
> Claudio Grondi <[EMAIL PROTECTED]>
> Date:
> Wed, 18 Jan 2006 19:59:12
Steve Holden wrote:
> Claudio Grondi wrote:
>
>> Steve Holden wrote:
>
> [...]
>
>> The problem here is, that I mean, that in Python it makes no sense to
>> talk about a value of an object, because it leads to weird things when
>> trying to give a definition what a value of an object is.
>>
>
Fredrik Lundh wrote:
> Fuzzyman wrote:
>
> > I'm not familiar with the C basic datatypes - I assume it has an array
> > or list like object.
> >
> > Would it contain a sequence of poitners to the members ? In which case
> > they would only be equal if the pointers are the same.
> >
> > In this cas
Fuzzyman wrote:
> I'm not familiar with the C basic datatypes - I assume it has an array
> or list like object.
>
> Would it contain a sequence of poitners to the members ? In which case
> they would only be equal if the pointers are the same.
>
> In this case :
>
> a = ['some string']
> b = ['som
Peter Hansen wrote:
> Claudio Grondi wrote:
> > but I mean, that it is not possible to use 'is' as replacement for '=='
> > operator to achieve in Python same behaviour as it is the case in C and
> > Javascript when comparing values with '=='.
> > 'is' does the C, Javascript job when comparing lis
Fuzzyman wrote:
> I'm not familiar with the C basic datatypes - I assume it has an array
> or list like object.
>
> Would it contain a sequence of poitners to the members ? In which case
> they would only be equal if the pointers are the same.
>
> In this case :
>
> a = ['some string']
> b = ['som
So you're no longer wanting to test for equality (as Fredrik has
pointed out).
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
--
http://mail.python.org/mailman/listinfo/python-list
Fuzzyman wrote:
> I'm not familiar with the C basic datatypes - I assume it has an array
> or list like object.
>
> Would it contain a sequence of poitners to the members ? In which case
> they would only be equal if the pointers are the same.
>
> In this case :
>
> a = ['some string']
> b = ['som
Claudio Grondi wrote:
> As also the fact, that when
> a = [1,2.0,3L]
> b = [1.0,2,3 ]
> a==b # gives True
> even if the objects in the lists are actually different,
> or when the objects being members of the list redefine __eq__ so, that
> no matter how different they are, the lists always compare
Claudio Grondi wrote:
> As also the fact, that when
> a = [1,2.0,3L]
> b = [1.0,2,3 ]
> a==b # gives True
> even if the objects in the lists are actually different,
they all compare equal:
>>> 1 == 1.0
True
>>> 2.0 == 2
True
>>> 3L == 3
True
> or when the objects being members of the list redef
I'm not familiar with the C basic datatypes - I assume it has an array
or list like object.
Would it contain a sequence of poitners to the members ? In which case
they would only be equal if the pointers are the same.
In this case :
a = ['some string']
b = ['somestring']
a == b
False (probably)
Fuzzyman wrote:
> Oops... my misreading, sorry.
>
> The reason that, in Python, short ints have the same identity is not
> fickle - it's just True. Python creates a new reference (pointer) to
> the same object.
>
> You're saying you want one comparison operator that for :
>
>
>>a=[1]
>>... many
Ok... so I'm now assuming that the information about '==' provided by
the above gentleman *and* that I understand it correctly.
The only confusion in C (which doesn't have classes) is that two list
(like) objects can't be tested by value - only identity.
In Java, comparing strings using '==' comp
Fuzzyman wrote:
> Ok... so I'm now assuming that the information about '==' provided by
> the above gentleman *and* that I understand it correctly.
>
> The only confusion in C (which doesn't have classes) is that two list
> (like) objects can't be tested by value - only identity.
>
In C, they are
Fuzzyman wrote:
> Claudio Grondi wrote:
> [snip..]
>
>>Yes, I know about 'is',
>>
>>but I mean, that it is not possible to use 'is' as replacement for '=='
>>operator to achieve in Python same behaviour as it is the case in C and
>>Javascript when comparing values with '=='.
>>'is' does the C, Jav
Fuzzyman wrote:
> The above gentleman is asserting that in *Python* the term value has no
> meaning.
I don't know what he meant and don't want to get into that
value/reference/object thingy discussion as it would be a never ending
thing. I just want to say that '==' in C is very clear to me, wheth
[EMAIL PROTECTED] wrote:
> Fuzzyman wrote:
> > Claudio Grondi wrote:
> > > Steve Holden wrote:
> > [snip..]
> > > The problem here is, that I mean, that in Python it makes no sense to
> > > talk about a value of an object, because it leads to weird things when
> > > trying to give a definition wha
Claudio Grondi wrote:
> but I mean, that it is not possible to use 'is' as replacement for '=='
> operator to achieve in Python same behaviour as it is the case in C and
> Javascript when comparing values with '=='.
> 'is' does the C, Javascript job when comparing lists, but I mean it
> fails to
Fuzzyman wrote:
> Claudio Grondi wrote:
> > Steve Holden wrote:
> [snip..]
> > The problem here is, that I mean, that in Python it makes no sense to
> > talk about a value of an object, because it leads to weird things when
> > trying to give a definition what a value of an object is.
> >
>
> You'
Claudio Grondi wrote:
> Steve Holden wrote:
[...]
> The problem here is, that I mean, that in Python it makes no sense to
> talk about a value of an object, because it leads to weird things when
> trying to give a definition what a value of an object is.
>
I don;t understand why you say that.
>
Oops... my misreading, sorry.
The reason that, in Python, short ints have the same identity is not
fickle - it's just True. Python creates a new reference (pointer) to
the same object.
You're saying you want one comparison operator that for :
> a=[1]
> ... many other statements here ...
> b=[1]
Claudio Grondi wrote:
[snip..]> > Perhaps you could try again in English? :-) Sorry, that's a
very complex
> > sentence and it isn't clear what yo mean.
> Here in English ;-) :
> a=[1]
> ... many other statements here ...
> b=[1]
> a is b # False
> a == b # True
> a[0] is b[0] # unpredictable(?)
Steve Holden wrote:
> Claudio Grondi wrote:
> [...]
>
>>>
>> Yes, I know about 'is',
>>
>> but I mean, that it is not possible to use 'is' as replacement for
>> '==' operator to achieve in Python same behaviour as it is the case in
>> C and Javascript when comparing values with '=='.
>> 'is' doe
Claudio Grondi wrote:
> Steve Holden wrote:
[snip..]
> The problem here is, that I mean, that in Python it makes no sense to
> talk about a value of an object, because it leads to weird things when
> trying to give a definition what a value of an object is.
>
You're saying that C and Java get rou
Claudio Grondi wrote:
[snip..]
> Yes, I know about 'is',
>
> but I mean, that it is not possible to use 'is' as replacement for '=='
> operator to achieve in Python same behaviour as it is the case in C and
> Javascript when comparing values with '=='.
> 'is' does the C, Javascript job when compar
Claudio Grondi wrote:
[...]
>>
> Yes, I know about 'is',
>
> but I mean, that it is not possible to use 'is' as replacement for '=='
> operator to achieve in Python same behaviour as it is the case in C and
> Javascript when comparing values with '=='.
> 'is' does the C, Javascript job when comp
prefix' code assigning to a
>>>> and b something special, so, that Python gets trapped in an endless
>>>> loop in a line with:
>>>>
>>>> if a==b: print 'OK'
>>>>
>>>> I mean, it would be of much help to me on my
probably looking for the identity operator which just
> (effectively) compares pointers ('is').
>
>a is b
>
> does more what you would expect.
>
> This is a better system than the ones you describe. :-)
>
> All the best,
>
> Fuzzyman
> http:/
Claudio Grondi wrote:
> Steve Holden wrote:
>
>>Claudio Grondi wrote:
>>
>>
>>>In the process of learning about some deeper details of Python I am
>>>curious if it is possible to write a 'prefix' code assigning to a and
>>>b somet
oes more what you would expect.
This is a better system than the ones you describe. :-)
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> With the solution to the question above I intended to have an example of
> Python code which outcome is an endless loop and the p
Steve Holden wrote:
> Claudio Grondi wrote:
>
>> In the process of learning about some deeper details of Python I am
>> curious if it is possible to write a 'prefix' code assigning to a and
>> b something special, so, that Python gets trapped in an endless loop
Claudio Grondi wrote:
> In the process of learning about some deeper details of Python I am
> curious if it is possible to write a 'prefix' code assigning to a and b
> something special, so, that Python gets trapped in an endless loop in a
> line with:
>
> if a==b
Claudio Grondi wrote:
> In the process of learning about some deeper details of Python I am
> curious if it is possible to write a 'prefix' code assigning to a and b
> something special, so, that Python gets trapped in an endless loop in a
> line with:
>
> if a==b: pri
In the process of learning about some deeper details of Python I am
curious if it is possible to write a 'prefix' code assigning to a and b
something special, so, that Python gets trapped in an endless loop in a
line with:
if a==b: print 'OK'
I mean, it would be of much
98 matches
Mail list logo