Re: Working with method-wrapper objects

2005-05-03 Thread Dr. Peer Griebel
Bengt Richter wrote: On Thu, 28 Apr 2005 11:33:04 +0200, Dr. Peer Griebel [EMAIL PROTECTED] wrote: Peer Dr. Griebel wrote: [..] Why has [].__str__ a different type than object.__str__? Why is object.__str__ a routine while object().__str__ not? Why wouldn't you expect different

Re: Working with method-wrapper objects

2005-04-29 Thread Bengt Richter
On Thu, 28 Apr 2005 11:33:04 +0200, Dr. Peer Griebel [EMAIL PROTECTED] wrote: Peer Dr. Griebel wrote: [..] Why has [].__str__ a different type than object.__str__? Why is object.__str__ a routine while object().__str__ not? Why wouldn't you expect different types? Those are different

Re: Working with method-wrapper objects

2005-04-28 Thread Dr. Peer Griebel
Peer Dr. Griebel wrote: I think I was a little bit unspecific in my last mail. I would like to see some description about method-wrapper and wrapper_descriptor objects. I dont' understand the following behaviour: type([].__str__) type 'method-wrapper' type(object.__str__) type

Re: Working with method-wrapper objects

2005-04-28 Thread Steven Bethard
Dr. Peer Griebel wrote: Why has [].__str__ a different type than object.__str__? Why is object.__str__ a routine while object().__str__ not? Well, I don't know why inspect.isroutine does what it does, but if you really need to detect these, can you do something like: py MethodWrapperType =

Re: Working with method-wrapper objects

2005-04-19 Thread Peer Dr. Griebel
I think I was a little bit unspecific in my last mail. I would like to see some description about method-wrapper and wrapper_descriptor objects. I dont' understand the following behaviour: type([].__str__) type 'method-wrapper' type(object.__str__) type 'wrapper_descriptor'

Working with method-wrapper objects

2005-04-18 Thread Peer Dr. Griebel
Hi, I'm currently working on a Python Management Console. During inspection of my objects I stumbled over method-wrapper objects. Such an object may be obtained e.g. as method_wrapper = [].__str__ My problem is: This object is not a method, not a function, not a method descriptor. And it