Fredrik Lundh wrote:
> Philippe Martin wrote:
>
>> l_init really is a boolean parameter and l_value a value that _might_
>> exist in a shelve.
>>
>> So I just want to have a parameter to a method so if the first value
>> tested is false (l_init) then the second (l_value) does not get tested
>> ..
bruno at modulix wrote:
> Philippe Martin wrote:
>> bruno at modulix wrote:
>>
>>
>>>Philippe Martin wrote:
>>>(snip)
>>>
l_init really is a boolean parameter and l_value a value that _might_
exist in a shelve.
So I just want to have a parameter to a method so if the first value
Philippe Martin wrote:
> bruno at modulix wrote:
>
>
>>Philippe Martin wrote:
>>(snip)
>>
>>>l_init really is a boolean parameter and l_value a value that _might_
>>>exist in a shelve.
>>>
>>>So I just want to have a parameter to a method so if the first value
>>>tested is false (l_init) then the
bruno at modulix wrote:
> Philippe Martin wrote:
> (snip)
>>
>> l_init really is a boolean parameter and l_value a value that _might_
>> exist in a shelve.
>>
>> So I just want to have a parameter to a method so if the first value
>> tested is false (l_init) then the second (l_value) does not ge
"Philippe Martin" schrieb
> Hi,
>
> This code works, but is it "appropriate" ?
>
> l_init = False
>
> if True == l_init and 1234 = l_value:
> print 'l_value is initialized'
>
> I know I can do this with a try but ...
>
I am a Python newbie, but I think working with
l_value = None
would be t
Philippe Martin wrote:
> l_init really is a boolean parameter and l_value a value that _might_ exist
> in a shelve.
>
> So I just want to have a parameter to a method so if the first value tested
> is false (l_init) then the second (l_value) does not get tested ... because
> it is the second in th
Philippe Martin wrote:
(snip)
>
> l_init really is a boolean parameter and l_value a value that _might_ exist
> in a shelve.
>
> So I just want to have a parameter to a method so if the first value tested
> is false (l_init) then the second (l_value) does not get tested ... because
> it is the se
Philippe Martin wrote:
> Hi,
>
> This code works, but is it "appropriate" ?
appropriate for what ?-)
> l_init = False
> # corrected typo, cf other post in this thread
> if True == l_init and 1234 == l_value:
> print 'l_value is initialized'
Do this in production code, and have one of the first
Larry Bates wrote:
> Philippe Martin wrote:
>> Hi,
>>
>> This code works, but is it "appropriate" ?
>>
>> l_init = False
>>
>> if True == l_init and 1234 = l_value:
>> print 'l_value is initialized'
>>
>> I know I can do this with a try but ...
>>
>> Philippe
>>
>>
> 1) You have a syntax
Philippe Martin wrote:
> Hi,
>
> This code works, but is it "appropriate" ?
>
> l_init = False
>
> if True == l_init and 1234 = l_value:
> print 'l_value is initialized'
>
> I know I can do this with a try but ...
>
> Philippe
>
>
1) You have a syntax error 1234 == l_value (note ==)
2) This
I'm sorry (typo):
l_init = False
if True == l_init and 1234 == l_value:
print 'l_value is initialized'
Note that 1234 == l_value does not get evaluated.
Philippe
vbgunz wrote:
> you don't have to say:
>
> if True == l_init
>
> it is suggested you simply say:
>
> if l_init:
>
> Reme
you don't have to say:
if True == l_init
it is suggested you simply say:
if l_init:
Remember the and operator requires expressions on both sides to be true
to continue. If you notice, your expression on the right side of the
'and' is an assignment and so this is forbidden (SyntaxError).
assignm
Hi,
This code works, but is it "appropriate" ?
l_init = False
if True == l_init and 1234 = l_value:
print 'l_value is initialized'
I know I can do this with a try but ...
Philippe
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo