[issue4101] Missing type in "types" module

View: New views
2 Messages — Rating Filter:   Alert me  

[issue4101] Missing type in "types" module

by David W. Lambert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


New submission from Antoine d'Otreppe <a.dotreppe@...>:

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 <report@...>
<http://bugs.python.org/issue4101>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/lists%40nabble.com


[issue4101] Missing type in "types" module

by David W. Lambert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Benjamin Peterson <musiccomposition@...> added the comment:

At the moment, we're not adding things to the type module because it may
eventually go away.

Since WrapperDescriptorType implements the descriptor protocol you can
get the __init__ method just by using it.

----------
nosy: +benjamin.peterson
resolution:  -> wont fix
status: open -> closed

_______________________________________
Python tracker <report@...>
<http://bugs.python.org/issue4101>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/lists%40nabble.com

LightInTheBox - Buy quality products at wholesale price!