Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a more compatable way to get wrapper_descriptor and method_wrapper #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions funcsigs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
__all__ = ['BoundArguments', 'Parameter', 'Signature', 'signature']


_WrapperDescriptor = type(type.__call__)
_MethodWrapper = type(all.__call__)
_WrapperDescriptor = type(bytearray.__add__)
_MethodWrapper = type(u'str'.__add__)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not plain 'str'.__add__? u'' introduces an incompatibility with Python 3.2

Copy link
Author

@Daetalus Daetalus Sep 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm... This is because in Pyston, the type of 'str'.__add__ still is instancemethod.

Pyston v0.6.0 (rev 8dd1298946b5dbe2b28f75a7a6d2de6486765438), targeting Python 2.7.7
>> type('str'.__add__)
<type 'instancemethod'>
>> type(u'str'.__add__)
<type 'method-wrapper'>

And according the description of funcsigs in README file, I thought we can drop the Python 3.2 support.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me :-)


_NonUserDefinedCallables = (_WrapperDescriptor,
_MethodWrapper,
Expand Down