ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
Re: [Tutor] Local vs global
by Bibi Midi other posts by this author
Nov 7 2009 7:22PM messages near this date
Re: [Tutor] Local vs global | Re: [Tutor] Local vs global
On Sat, Nov 7, 2009 at 3:26 PM, Dave Angel <davea@[...].org>  wrote:
>  Alan Gauld wrote:
> >
>  Alan - Excellent comments, as usual.
> 
>  bibimidi - I would point out that after you remove the 'global choose'
line
>  as Alan said, you should rename the global variable you're using to store
>  the return value.  They're allowed to have the same name, but it's
confusing
>  to a beginner if they do, since you might assume they somehow share the
>  value.
> 

Thank you all for the helpful insights. I will keep in mind the naming
rules in Python, so as not to have it in collision with Python's
builtins.

The mention to tidy up e.g. "compartmentalize" code is also noted. I
agree definitely.

I'm reworking my code and will post back.




--
Best Regards

Marie von Ebner-Eschenbach  - "Even a stopped clock is right twice a
day." -
http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html



-- 
Best Regards,
bibimidi
Thread:
Bibi Midi
Alan Gauld
Bibi Midi
Bibi Midi
Bibi Midi
Lie Ryan
Dave Angel
Alan Gauld
Dave Angel
Eri Mendz

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved