python3: accessing the result of 'if'

Nick Coghlan ncoghlan at
Sun Jan 9 02:19:13 EST 2005

Carl Banks wrote:
> I'm sorry, I really can't agree that this helper function "solves" it.
> IMO, it's a workaround, not a solution.  And, if I may be frank, it's a
> pretty ugly one.

Heck, I thought it was ugly and I wrote it :)

So in reality, I'd continue to use the nested-if approach that works right now 
if I wanted access to part of the condition instead of the whole thing.

However, being able to bind a name to the conditions would be handy for many cases.


Nick Coghlan   |   ncoghlan at   |   Brisbane, Australia

More information about the Python-list mailing list