On Thu, 3 Jun 2010 11:50:42 -0400
Tino Dai <obe...@gmail.com> wrote:

> Hi All,
> 
>     Is there a way to express this:
>     isThumbnail = False
>     if size == "thumbnail":
>         isThumbnail = True
> 
>      like this:
>      [ isThumbnail = True if size == "thumbnail" isThumbnail = False ]
>      and the scoping extending to one level above without resorting to the
> global keyword?

If you are not in a function, then your question does not make sense for 
python. If you are in a function, then isThumbnail must have been defined 
before and you must use global, yes.
Thus, maybe no need for complicated expression:

isThumbnail = False;
def f(size):
  global isThumbnail
  if size == "thumbnail":
    isThumbnail = True



> Thanks,
> Tino



-- 
________________________________

vit esse estrany ☣

spir.wikidot.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to