-
Notifications
You must be signed in to change notification settings - Fork 11
Py23 more #215
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
Py23 more #215
Conversation
I've also re-worked the Python 2 version so that it should now work for Python 3. But the Python-3 only version is much simpler. Also, the Python 2 version raises deprecation warnings in Python 3 (for getargspec).
|
Excellent. I'll trade you a review of this for #214 ;-) |
zip, map, filter, .keys(), .items(), and .values() return single-use iterators in Python 3, but lists in Python 2. I've changed all instances of these iterators to explicit lists unless the instance is immediately consumed (i.e., not given a reference for reuse).
|
This is getting to be a chunky PR - almost at 700 lines here. I figure there's more you want to do, but is this reviewable as is? (I'd prefer not to do a 1000 line PR...) |
Even though this is consumed immediately in a for-loop, it needs to be a list not a generator since its dictionary is being modified.
When used on class constructors:
```python
class Foo(object):
def __call__(self, x):
return x
```
get_number_of_args_py2 previously returned the number of arguments in Foo.__call__, which was incorrect, since calling Foo(...) would run the __init__ method!
|
Sure, this is ready for review. Most of the +500 –300 lines are reasonably trivial changes to the doctests. |
|
BTW: Only 8 Python 3 tests are failing. I'll tackle them tomorrow. |
|
Alrighty, will tackle this first thing tomorrow morning! |
jolyonb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me. Very minor changes requested.
jolyonb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍. Will merge when tests complete.
No description provided.