Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45245 > unrolled thread

Re: global variable not working inside function. Increment

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2013-05-13 17:07 +0200
Last post2013-05-13 17:07 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Re: global variable not working inside function. Increment Jean-Michel Pichavant <jeanmichel@sequans.com> - 2013-05-13 17:07 +0200

#45245 — Re: global variable not working inside function. Increment

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2013-05-13 17:07 +0200
SubjectRe: global variable not working inside function. Increment
Message-ID<mailman.1628.1368457664.3114.python-list@python.org>
> Thank You for setting that straight. I'm just learning Python and
> NONE of the tutorials I read said anything about that . In fact they
> all say a global can be called from inside a Function. If possible
> please contact the ppl that write these things.....I've heard of
> Ocam's razor but not Hanlon's???
> --
> http://mail.python.org/mailman/listinfo/python-list

It's covered by this one:
http://docs.python.org/2/tutorial/classes.html#python-scopes-and-namespaces

It's flagged as a quirk python behavior, and probably could afford a code sample, it can be difficult to grasp from the formal description.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web