if statement, with function inside it: if (t = Test()) == True:

Paul Rubin http
Fri Apr 24 06:25:50 EDT 2009


Chris Rebert <clp2 at rebertia.com> writes:
> Python forces you to do it the "long way" (the Right Way(tm) if you
> ask most Python partisans).
> 
> If you could explain your situation and the context of your question
> in greater detail, someone might be able to suggest an alternate
> structure for your code which obviates your desire for such a
> construct.

One very common situation is matching something against a series of
regexps, and "ugly hacks" often end up being more attractive than "the
long way".

If you want to do it "the pointy headed way", start with the article

http://www.valuedlessons.com/2008/01/monads-in-python-with-nice-syntax.html



More information about the Python-list mailing list