On Sat, 17 Nov 2007 09:08:48 +0200, Janne Härkönen
wrote:
> I am sorry to have wasted your precious time in such oafish manner.
And so you should be, and as soon as I can track down your address I'll
be sending you the bill.
*wink*
--
Steven.
--
http://mail.python.org/mailman/listinfo/pyth
On Nov 16, 2007 10:51 PM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Fri, 16 Nov 2007 19:02:25 +0200, Janne Härkönen
> wrote:
>
> >> X is an "old style" class. Most people probably shouldn't use old style
> >> classes, for various reasons. To use new style classes, you inherit
> >> from object
On Nov 16, 2007 2:51 PM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Fri, 16 Nov 2007 19:02:25 +0200, Janne Härkönen
> wrote:
>
> >> X is an "old style" class. Most people probably shouldn't use old style
> >> classes, for various reasons. To use new style classes, you inherit
> >> from object:
On Nov 16, 8:51 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> There should be a term for "optimization" techniques that actually slow
> things down instead of speeding them up.
>
I belive those are the ones known as "premature optimizations", which
sit at the root of all evil
On Fri, 16 Nov 2007 19:02:25 +0200, Janne Härkönen
wrote:
>> X is an "old style" class. Most people probably shouldn't use old style
>> classes, for various reasons. To use new style classes, you inherit
>> from object:
>
> I am also aware of old and new style classes, this was the fastest way
>
On Nov 15, 2007 11:07 PM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Thu, 15 Nov 2007 13:01:27 +0200, Janne Härkönen
> wrote:
>
> Have you tried looking at dir(TheClass) to see what it lists?
This is the first thing I did, but it shows both the inherited and own
methods.
> Also helpful is Th
On Thu, 15 Nov 2007 13:01:27 +0200, Janne Härkönen
wrote:
> Hello,
>
> Is there a simple way to resolve declaring class of a method at runtime
> ?
Have you tried looking at dir(TheClass) to see what it lists?
Also helpful is TheClass.__dict__.keys().
Python has powerful introspection abilities
Janne Härkönen wrote:
class X:
> ... def x(self):
> ...pass
> ...
class Y(X):
> ... def y(self):
> ...pass
> ...
y = Y()
y.x.im_class
>
y.y.im_class
>
>
> What I would like to find out is the declaring class of method x,
> ie. class X How to do this ?
The g
"Janne Härkönen" <[EMAIL PROTECTED]> wrote:
> $ python
> Python 2.5.1 (r251:54863, May 18 2007, 16:56:43)
> [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
> Type "help", "copyright", "credits" or "license" for more information.
class X:
> ... def x(self):
> ...pass
>