Re: Python Style Guide Questions - Contd.

2009-01-22 Thread Aahz
In article <6tk9qqfbav8...@mid.uni-berlin.de>, Marc 'BlackJack' Rintsch wrote: > >PEP8 doesn't mention constants at all. Not true anymore. ;-) -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ Weinberg's Second Law: If builders built buildings the way programm

Re: Python Style Guide Questions - Contd.

2009-01-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 Jan 2009 05:50:54 -0800, koranthala wrote: > Hi, >I have some more questions about python code styling. 1. Global >Variables: In my code, I am using some global variables. > Now, when I ran PyLint, it raised convention errors mentioning that they > should be CAPITAL_ALPHABETS. N

Re: Python Style Guide Questions - Contd.

2009-01-19 Thread Diez B. Roggisch
koranthala wrote: > Hi, >I have some more questions about python code styling. >1. Global Variables: In my code, I am using some global variables. > Now, when I ran PyLint, it raised convention errors mentioning that > they should be CAPITAL_ALPHABETS. Now, in PEP 8, I did not see that > m

Python Style Guide Questions - Contd.

2009-01-19 Thread koranthala
Hi, I have some more questions about python code styling. 1. Global Variables: In my code, I am using some global variables. Now, when I ran PyLint, it raised convention errors mentioning that they should be CAPITAL_ALPHABETS. Now, in PEP 8, I did not see that mentioned. Please let me know wh

Re: Python Style Guide Questions

2009-01-15 Thread Ben Finney
koranthala writes: > import x > b = x.a > or > from x import a > b = a > >I read in Learning Python that it is always better to use the > former - especially since namespace wont be dirtied. The namespace isn't really dirtied by ‘from foo import spam’, since it's clear within t

Re: Python Style Guide Questions

2009-01-15 Thread koranthala
On Jan 16, 12:00 pm, Terry Reedy wrote: > koranthala wrote: > > Hi, > >    Which is more advisable? > > import x > > b = x.a > >              or > > from x import a > > b = a > > If I know I want just one thing from x, I tend to use latter. > I also like 'import xyzlib as x' > > >    I read in Lea

Re: Python Style Guide Questions

2009-01-15 Thread Terry Reedy
koranthala wrote: Hi, Which is more advisable? import x b = x.a or from x import a b = a If I know I want just one thing from x, I tend to use latter. I also like 'import xyzlib as x' I read in Learning Python that it is always better to use the former - especially since na

Re: Python Style Guide Questions

2009-01-15 Thread Steven D'Aprano
On Thu, 15 Jan 2009 22:13:06 -0800, koranthala wrote: > Hi, >Which is more advisable? > import x > b = x.a > or > from x import a > b = a > >I read in Learning Python that it is always better to use the > former Perhaps not "always", but often. > - especially since namespa

Python Style Guide Questions

2009-01-15 Thread koranthala
Hi, Which is more advisable? import x b = x.a or from x import a b = a I read in Learning Python that it is always better to use the former - especially since namespace wont be dirtied. But, doing that with PEP 8 together causes my code to look rather cluttered. Reason being tha