Re: what does ^ do in python

2008-03-27 Thread castironpi
On Mar 26, 1:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson <[EMAIL PROTECTED]>   > escribió: > > > HOw can we use express pointers as in C or python? > > Traceback (most recent call last): >    File "", line 1, in >    File "parser.py",

Re: what does ^ do in python

2008-03-27 Thread Steven D'Aprano
On Wed, 26 Mar 2008 19:45:34 +0100, Heiko Wundram wrote: > Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: >> HOw can we use express pointers as in C or python? > > There's no such thing as a pointer in Python, so you can't "express" > them either. Was this what you were trying to ask

Re: what does ^ do in python

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 16:14:07 -0300, David Anderson <[EMAIL PROTECTED]> escribió: > The right question was:HOw can we use/express pointers python as in C or > Pascal? I think you should read this article: http://effbot.org/zone/python-objects.htm and then: http://effbot.org/zone/call-by-object

Re: what does ^ do in python

2008-03-26 Thread Dan Stromberg
On Wed, 26 Mar 2008 19:45:34 +0100, Heiko Wundram wrote: > Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: >> HOw can we use express pointers as in C or python? > > There's no such thing as a pointer in Python, so you can't "express" > them either. Was this what you were trying to ask

Re: what does ^ do in python

2008-03-26 Thread David Anderson
ANd... By express I mean... Dereferencing... Habits from my native language where the verb express also means this On Wed, Mar 26, 2008 at 4:14 PM, David Anderson <[EMAIL PROTECTED]> wrote: > Err even I cant understand what I wrote... > The right question was:HOw can we use/express pointers pyth

Re: what does ^ do in python

2008-03-26 Thread David Anderson
Err even I cant understand what I wrote... The right question was:HOw can we use/express pointers python as in C or Pascal? But thx to Heiko, He got what I mean =) On Wed, Mar 26, 2008 at 3:46 PM, Tim Chase <[EMAIL PROTECTED]> wrote: > >> HOw can we use express pointers as in C or python? > > > >

Re: what does ^ do in python

2008-03-26 Thread Tim Chase
>> HOw can we use express pointers as in C or python? > > Traceback (most recent call last): >File "", line 1, in >File "parser.py", line 123, in parse_text > tree = language.parse_text(text) >File "english.py", line 456, in parse_text > tree = self.parse_sentence(sentence)

Re: what does ^ do in python

2008-03-26 Thread Michael Wieher
On Wed, Mar 26, 2008 at 1:36 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson <[EMAIL PROTECTED]> > escribió: > > > HOw can we use express pointers as in C or python? > > File "english.py", line 345, in parse_sentence > raise ParserError,

Re: what does ^ do in python

2008-03-26 Thread Heiko Wundram
Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: > HOw can we use express pointers as in C or python? There's no such thing as a pointer in Python, so you can't "express" them either. Was this what you were trying to ask? -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/p

Re: what does ^ do in python

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson <[EMAIL PROTECTED]> escribió: > HOw can we use express pointers as in C or python? Traceback (most recent call last): File "", line 1, in File "parser.py", line 123, in parse_text tree = language.parse_text(text) File "english.py

Re: what does ^ do in python

2008-03-26 Thread David Anderson
HOw can we use express pointers as in C or python? On Tue, Mar 25, 2008 at 7:36 PM, Tim Chase <[EMAIL PROTECTED]> wrote: > > In most of the languages ^ is used for 'to the power of'. > > > > No, not in most languages. In most languages (C, C++, Java, C#, Python, > > Fortran, ...), ^ is the xor op

Re: what does ^ do in python

2008-03-25 Thread Tim Chase
> In most of the languages ^ is used for 'to the power of'. > > No, not in most languages. In most languages (C, C++, Java, C#, Python, > Fortran, ...), ^ is the xor operator ;) ...and in Pascal it's the pointer-dereferencing operator... -tkc -- http://mail.python.org/mailman/listinfo/python-

Re: what does ^ do in python

2008-03-25 Thread Matthieu Brucher
Hi, In most of the languages ^ is used for 'to the power of'. > No, not in most languages. In most languages (C, C++, Java, C#, Python, Fortran, ...), ^ is the xor operator ;) Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and h

Re: what does ^ do in python

2008-03-25 Thread Heiko Wundram
Am Dienstag, 25. März 2008 23:02:00 schrieb Dark Wind: > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? ^ is the binary exclusive-or (xor) operator. Possibly it helps to see the following (numbers are in binary) to get the drift: 0

Re: what does ^ do in python

2008-03-25 Thread Christian Heimes
Dark Wind schrieb: > Hi, > > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? > I could not get it just by using it ... some examples are: > 1^1 returns 0 > 2^2 returns 0 > 1^4 returns 5 > 4^1 returns 5 > 3^5 returns 6 > 5^3 returns 6 .

Re: what does ^ do in python

2008-03-25 Thread Guilherme Polo
2008/3/25, Dark Wind <[EMAIL PROTECTED]>: > Hi, > > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? It is bitwise xor. Some more information can be found at http://docs.python.org/ref/bitwise.html > I could not get it just by using it