On 10/7/07, Dekker <[EMAIL PROTECTED]> wrote:
>
> Well I think it is not possible what I wanted to achieve. By
> overriding the "and" and "or" keyword I wanted to return a new object:
>
> SqlValueInt(4) and SqlValueInt(5) --> SqlOpAnd(SqlValueInt(4),
> SqlValueInt(5))
PEP 335 is a proposal to allo
On 8/10/2007 1:57 AM, Diez B. Roggisch wrote:
> Kay Schluehr schrieb:
>> You can see what "and" and "or" are actually doing:
>>
>> import dis
>> dis.dis(lambda: x or y and z)
>>
>> 1 0 LOAD_GLOBAL 0 (x)
>> 3 JUMP_IF_TRUE11 (to 17)
>>
Kay Schluehr schrieb:
> On Oct 7, 4:48 pm, Dekker <[EMAIL PROTECTED]> wrote:
>> On 7 Okt., 16:19, Steven D'Aprano <[EMAIL PROTECTED]
>>
>> cybersource.com.au> wrote:
>>> On Sun, 07 Oct 2007 13:52:15 +, Dekker wrote:
Is it possible to override 'and' and/or 'or'?
>>> Not without hacking the
Steven D'Aprano a écrit :
> On Sun, 07 Oct 2007 16:24:35 +0200, Wildemar Wildenburger wrote:
>
>> Wildemar Wildenburger wrote:
>>> [whate everyone else wrote :(]
>>>
>>> /W
>> Dangit! 4th of 4.
>> Gotta type quicker.
>
>
> That's okay, in two weeks time there will be 139 messages in this thread,
On Oct 7, 4:48 pm, Dekker <[EMAIL PROTECTED]> wrote:
> On 7 Okt., 16:19, Steven D'Aprano <[EMAIL PROTECTED]
>
> cybersource.com.au> wrote:
> > On Sun, 07 Oct 2007 13:52:15 +, Dekker wrote:
> > > Is it possible to override 'and' and/or 'or'?
>
> > Not without hacking the Python source code, in w
Dekker wrote:
> Well... I have to live with the (binary) __and__, __or__ option and
> the user has to write:
>
> SqlValueInt(4) & SqlValueInt(5) --> SqlOpAnd(SqlValueInt(4),
> SqlValueInt(5))
>
> Thanks for your input, but __nonzero__ is not of any help in this
> case... I want to abuse the "magi
On 7 Okt., 16:19, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sun, 07 Oct 2007 13:52:15 +, Dekker wrote:
> > Is it possible to override 'and' and/or 'or'?
>
> Not without hacking the Python source code, in which case what you've got
> is no longer Python.
>
> Why do you w
On Sun, 07 Oct 2007 16:24:35 +0200, Wildemar Wildenburger wrote:
> Wildemar Wildenburger wrote:
>> [whate everyone else wrote :(]
>>
>> /W
>
> Dangit! 4th of 4.
> Gotta type quicker.
That's okay, in two weeks time there will be 139 messages in this thread,
it will have devolved into an argume
Wildemar Wildenburger wrote:
> [whate everyone else wrote :(]
>
> /W
Dangit! 4th of 4.
Gotta type quicker.
/W
--
http://mail.python.org/mailman/listinfo/python-list
Dekker wrote:
> Is it possible to override 'and' and/or 'or'? I cannot find a special
> method for it... __and__ and __rand__ and __or__ and __ror__ are for
> binary manipulation... any proposals?
>
> Have marvelous sunday,
> Marco
>
I guess you're looking for __nonzero__()
http://docs.python.or
On Sun, 07 Oct 2007 13:52:15 +, Dekker wrote:
> Is it possible to override 'and' and/or 'or'?
Not without hacking the Python source code, in which case what you've got
is no longer Python.
Why do you want to do so?
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
Dekker a écrit :
> Is it possible to override 'and' and/or 'or'? I cannot find a special
> method for it... __and__ and __rand__ and __or__ and __ror__ are for
> binary manipulation... any proposals?
http://docs.python.org/ref/customization.html
"""
__nonzero__(self)
Called to implement t
Dekker <[EMAIL PROTECTED]> wrote:
> Is it possible to override 'and' and/or 'or'? I cannot find a special
> method for it... __and__ and __rand__ and __or__ and __ror__ are for
> binary manipulation... any proposals?
If you want to customize the truth value testing you have to implement
__nonzero_
13 matches
Mail list logo