python newbie
- From: Jim Hendricks <jim@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 02 Nov 2007 09:51:44 -0400
New to python, programming in 15 or so langs for 24 years.
Couple of questions the tuts I've looked at don't explain:
1) global vars - python sets scope to the block a var is declared (1st set), I see the global keyword that allows access to global vars in a function, what I'm not clear on is does that global need to be declared in the global scope, or, when 1st set in a function where it is listed as a global, does that then declare the necessary global.
2) Everything is an object. So then, why the distinction between functions/variables and fields/methods. If a module is an object, would not every function be a method of that module and every variable be a field of that module?
I'm sure I will have other questions, but, I have a specific task that I am coding in python, and having a better understanding of the language will keep me from writing crap based on other language bias.
TIA,
Jim
.
- Follow-Ups:
- Re: python newbie
- From: Bruno Desthuilliers
- Re: python newbie
- From: Neil Cerutti
- Re: python newbie
- From: Bjoern Schliessmann
- Re: python newbie
- From: BartlebyScrivener
- Re: python newbie
- Prev by Date: Re: MySQLdb.string_literal
- Next by Date: Copy database with python..
- Previous by thread: MySQLdb.string_literal
- Next by thread: Re: python newbie
- Index(es):
Relevant Pages
|
|