-
Notifications
You must be signed in to change notification settings - Fork 10.5k
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
get_func_args maximum recursion #728
Comments
same results for python2 and python3 >>> ig = itemgetter(0)
>>> [(n, f(ig), f(ig.__call__)) for n, f in vars(inspect).items() if n.startswith('is')]
[('isgenerator', False, False),
('isdatadescriptor', False, False),
('isframe', False, False),
('ismemberdescriptor', False, False),
('isabstract', False, False),
('isbuiltin', False, False),
('isfunction', False, False),
('istraceback', False, False),
('isgeneratorfunction', False, False),
('ismethod', False, False),
('iscode', False, False),
('isclass', False, False),
('ismethoddescriptor', False, False),
('isroutine', False, False),
('ismodule', False, False),
('isgetsetdescriptor', False, False)] |
at least we can detect it similar to what we did for partial >>> isinstance(ig, itemgetter)
True |
Do we want to fall more than one time on line https://github.com/scrapy/scrapy/blob/master/scrapy/utils/python.py#L166? |
+1 I can't imagine a better solution |
get_func_args maximum recursion fix #728
https://github.com/scrapy/scrapy/blob/master/scrapy/utils/python.py#L149
Today I was working on a project were I have to skip the first item of a list, and then join the rest. Instead of writing the typical slice I tried something much more good looking
Compose(itemgetter(slice(1, None)), Join())
but I found out this maximum recursion. I did some research and ask @dangra about it, but nothing came up.I think the main problem is that
inspect
isn't able recognizeitemgetter
assomething
.EDIT: Looks like the reason was C functions weren't covered by inspect module until Python 3.4 (http://bugs.python.org/issue17481)
The text was updated successfully, but these errors were encountered: