Re: Problems trying to override __str__ on path class

2006-10-23 Thread Mike Krell
Peter Otten <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > So my assumption was that you are using a pre-2.1 version of path. > I suggest that you double-check that by inserting a > > print path.__version__ > > into the code showing the odd behaviour before you start looking for > mo

Re: Problems trying to override __str__ on path class

2006-10-22 Thread Mike Krell
Peter Otten <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I get > > np: "overridden __str__: c:/mbk/test" > str(np): "overridden __str__: c:/mbk/test" > overridden __str__: overridden __str__: c:/mbk/test/appendtest Hmmm. I guess you're not running under windows, since normpath() co

Problems trying to override __str__ on path class

2006-10-22 Thread Mike Krell
I'm running into problems trying to override __str__ on the path class from Jason Orendorff's path module (http://www.jorendorff.com/articles/python/path/src/path.py). My first attempt to do this was as follows: ''' class NormPath(path): def __str__(self): return 'overridden __str__

Re: What are super()'s semantics?

2006-09-04 Thread Mike Krell
"Michele Simionato" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Anyway, the MRO concept is documented here: > > http://www.python.org/download/releases/2.3/mro/ A very edifying document. Indeed, in "Nutshell" Alex M. mentions your paper at the end of his high-level explanation of t

Re: What are super()'s semantics?

2006-09-04 Thread Mike Krell
Maric Michaud <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > [examples snipped] > > Hope this is clear. Yes, I get it now. In a prior section in "Nutshell", Alex M. goes over the MRO as well as the __mro__ attribute. I remembered the fact that the __mro__ attribute can be reference

What are super()'s semantics?

2006-09-04 Thread Mike Krell
I'm reading Alex Martelli's "Nutshell" second edition. In the section called "Cooperative superclass method calling", he presents a diamond inheritance hierachy: class A(object): def met(self): print "A.met" class B(A): def met(self): print "B.met" A.met(self) clas