Inline Conditionals?

Joshua Ginsberg joshg at brainstorminternet.net
Wed Aug 25 00:30:13 CEST 2004


Yeah... sorry with the bad example returning true or false...

Try this example :-D --

def foo(x):
	return foo == 'bar' ? 'w00t' : 'l33t'

-jag

On Tue, 2004-08-24 at 16:28, Chris Cioffi wrote:
> Um, try:
> 
> def isNegative(x):
>     return x < 0
> 
> But for the general case, no.  (Yes, there are many very creative
> "solutions" but none are truly general.)
> 
> Chris
> 
> On Tue, 24 Aug 2004 16:19:34 -0600, Joshua Ginsberg
> <joshg at brainstorminternet.net> wrote:
> > Is there any plan to include inline conditionals in Python? For example:
> > 
> > def isNegative(x):
> >         return x < 0 ? True : False
> > 
> > Thanks!
> > 
> > -jag
> > 
> > --
> > Joshua Ginsberg <joshg at brainstorminternet.net>
> > Brainstorm Internet Network Operations
> > 
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> > 
-- 
Joshua Ginsberg <joshg at brainstorminternet.net>
Brainstorm Internet Network Operations




More information about the Python-list mailing list