Skip to content

Conversation

@ChristopherChudzicki
Copy link
Collaborator

No description provided.

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).
@jolyonb
Copy link
Collaborator

jolyonb commented Jul 1, 2019

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).
@jolyonb
Copy link
Collaborator

jolyonb commented Jul 2, 2019

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!
@ChristopherChudzicki
Copy link
Collaborator Author

Sure, this is ready for review. Most of the +500 –300 lines are reasonably trivial changes to the doctests.

@ChristopherChudzicki
Copy link
Collaborator Author

BTW: Only 8 Python 3 tests are failing. I'll tackle them tomorrow.

@ChristopherChudzicki ChristopherChudzicki changed the title Py23 more [WIP] Py23 more Jul 2, 2019
@jolyonb
Copy link
Collaborator

jolyonb commented Jul 2, 2019

Alrighty, will tackle this first thing tomorrow morning!

Copy link
Collaborator

@jolyonb jolyonb left a 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.

Copy link
Collaborator

@jolyonb jolyonb left a 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.

@jolyonb jolyonb merged commit 0b44580 into mitodl:master Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants