Re: Assignment-in-conditional

2006-08-31 Thread Simon Forman
xamdam wrote: > Thanks for the FAQ, and for the 'casm ;) > > What do you think about using alternative syntax (something like 'as') > > - max > > Fredrik Lundh wrote: > > xamdam wrote: > > > > > I am not sure if this came up before, but

Re: Assignment-in-conditional

2006-08-31 Thread xamdam
Thanks for the FAQ, and for the 'casm ;) What do you think about using alternative syntax (something like 'as') - max Fredrik Lundh wrote: > xamdam wrote: > > > I am not sure if this came up before, but I would love to have an > > 'assignment-in-condition

Re: Assignment-in-conditional

2006-08-31 Thread Georg Brandl
xamdam wrote: > I am not sure if this came up before, but I would love to have an > 'assignment-in-conditional' form in python, e.g > > pat = re.compile('something') > > if m = pat.match(s): > m.group(1) > > Of course there is some concern abou

Re: Assignment-in-conditional

2006-08-31 Thread Neil Cerutti
On 2006-08-31, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > xamdam wrote: > >> I am not sure if this came up before, but I would love to have an >> 'assignment-in-conditional' form in python, e.g > > it's a FAQ, so it has probably come up before: >

Re: Assignment-in-conditional

2006-08-31 Thread Fredrik Lundh
xamdam wrote: > I am not sure if this came up before, but I would love to have an > 'assignment-in-conditional' form in python, e.g it's a FAQ, so it has probably come up before: http://pyfaq.infogami.com/why-can-t-i-use-an-assignment-in-an-expression -- http://ma

Assignment-in-conditional

2006-08-31 Thread xamdam
I am not sure if this came up before, but I would love to have an 'assignment-in-conditional' form in python, e.g pat = re.compile('something') if m = pat.match(s): m.group(1) Of course there is some concern about accidentally using '=' instead of '==&#x