[issue3445] functools.update_wrapper bug

2008-07-25 Thread Antoine d'Otreppe

New submission from Antoine d'Otreppe <[EMAIL PROTECTED]>:

When trying to do something like
"functools.update_wrapper(myWrapper, str.split)"

I got this error message:

Traceback (most recent call last):
  File "", line 1, in 
  File "Aspyct.py", line 175, in beforeCall
_stickAdvice(function, theAdvice)
  File "Aspyct.py", line 90, in _stickAdvice
functools.update_wrapper(theAdvice, function)
  File "/usr/lib/python2.5/functools.py", line 33, in update_wrapper
setattr(wrapper, attr, getattr(wrapped, attr))
AttributeError: 'method_descriptor' object has no attribute '__module__'

--
components: Library (Lib)
messages: 70256
nosy: Antoine d'Otreppe
severity: normal
status: open
title: functools.update_wrapper bug
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3445>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3445] Ignore missing attributes in functools.update_wrapper

2008-07-27 Thread Antoine d'Otreppe

Antoine d'Otreppe <[EMAIL PROTECTED]> added the comment:

Thank you for considering this report :)

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3445>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4101] Missing type in "types" module

2008-10-10 Thread Antoine d'Otreppe

New submission from Antoine d'Otreppe <[EMAIL PROTECTED]>:

Hello

There's a type missing in the standard "types" modules (or I didn't find
it, in what case I apologize for this useless posting)

Consider this code:

---
WrapperDescriptorType = None

class Meta(type):
def __init__(cls, *args, **kwargs):
global WrapperDescriptorType
type.__init__(cls, *args, **kwargs)
WrapperDescriptorType = type(cls.__init__)

class A:
__metaclass__ = Meta
---

I could not find WrapperDescriptorType in types module.

btw, I have to pass this descriptor to another function. But in fact I
don't need the wrapper but the real method. How to get it ?

--
components: Library (Lib)
messages: 74643
nosy: Antoine d'Otreppe
severity: normal
status: open
title: Missing type in "types" module
type: feature request
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4101>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4104] Namespace inconsistency

2008-10-10 Thread Antoine d'Otreppe

New submission from Antoine d'Otreppe <[EMAIL PROTECTED]>:

Hello

See the following code and comments for explanation ;) (Try it with
interactive mode)

---
>>> class A:
... class B:
... pass

>>> A

>>> A.B

>>> B
NameError: B is not defined
---

This seems to be inconsistent, as Python represents A.B as __main__.B,
but B is not accessable from __main__

Maybe this could be better:
---
>>> A.B

  ^
---

--
components: Interpreter Core
messages: 74648
nosy: Antoine d'Otreppe
severity: normal
status: open
title: Namespace inconsistency
type: feature request
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4104>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com