Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Adam Jiang
> * property only works in "new-style" classes that inherit from object; > > * likewise for super; Another question raised here is that what is the proper way to refer to parent class? For example, class A(object): def __init__(self, arg): print "A" class B(A): d

How to avoid PEP8 'imported but unused'

2013-05-05 Thread Adam Jiang
I am new to python. Now, I am woring on an application within Django framework. When I checked my code with pep8 and pyflakes, some warning messages show up-'Foobar imported but unused'. Obviously, it indicates that some modules are imprted to current module but never get references. However, it se

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Adam Jiang
module for the side effects, so > they issue a warning anyway. Assert'ing counts as using the module, so it > counts as an used import. > > On 5 May 2013 17:05, "Adam Jiang" wrote: > > > > I am new to python. Now, I am woring on an application within Django &g

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Adam Jiang
Thank you. Problem solved. /Adam On Sun, May 05, 2013 at 06:27:44PM +0100, Fábio Santos wrote: > That assert will never fail. If the symbol is not imported, the import > statement raises ImportError. And actually "assert" makes sure that > the value is not false-ish, not None/Null. And AFAIK a mod