Skip to content

Conversation

@alok
Copy link
Contributor

@alok alok commented Apr 30, 2018

Every supported version can use this syntax, and it's both faster and clearer.

Every supported version can use this syntax, and it's both faster and clearer.
@codecov-io
Copy link

codecov-io commented Apr 30, 2018

Codecov Report

Merging #169 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #169   +/-   ##
=======================================
  Coverage   83.85%   83.85%           
=======================================
  Files           1        1           
  Lines         539      539           
  Branches       95       95           
=======================================
  Hits          452      452           
  Misses         63       63           
  Partials       24       24
Impacted Files Coverage Δ
cloudpickle/cloudpickle.py 83.85% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b1e6ea...cd37e80. Read the comment docs.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

to me, im okay with it

out_names = set(names[oparg]
for op, oparg in _walk_global_ops(co))
out_names = {names[oparg]
for op, oparg in _walk_global_ops(co)}
Copy link
Member

Choose a reason for hiding this comment

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

indentation a bit weird here tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

The `op` arg isn't used for creating `out_names`, so we elide it.
@alok
Copy link
Contributor Author

alok commented May 1, 2018

Fixed lint errors.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

@alok BTW, mind checking if cloudpickle roughly worked on Python 2.6 too? I know it's something we don't officially support; however, if that worked before and this change breaks it, I doubt if we should fix these only for style reason.

@llllllllll
Copy link
Contributor

set literals were added in 2.7, so this will not work with 2.6. Though, if it is not supported, it is not supported, right?

@HyukjinKwon
Copy link
Member

Correct but I was thinking I wouldn't bother to fix styles if that breaks a potential practical use case. There's no gain here rather than styles but we might lose a practical use case.

@HyukjinKwon
Copy link
Member

dictionary and set comprehensions are good but set(...) and dict(...) are not deprecated and proper usage here too IIRC - if they are deprecated, it's fine.

If there's no gain better than styles, I would like to know if this was already broken with Python 2.6. It wouldn't be too challenging.

@alok
Copy link
Contributor Author

alok commented May 2, 2018

@HyukjinKwon This syntax won't work in 2.6.

set() and dict() are not deprecated, but the way they're used in cloudpickle is not their intended use. They're meant for converting data structures other than comprehensions. Those are covered by the literal syntax.

I think it's worth ignoring 2.6 anyway. Python 2 end-of-life is in 1 year, 7 months, 30 days, 2 hours, and 25 minutes as of this moment. I've yet to see someone use 2.6 these days. Any version of python 2 below 2.7 is not supported by any major library, and the entire scientific python stack is pretty much on 3+ now.

Using this as a rough metric, about 0.2% of pypi downloads are for 2.6. That's not a large enough userbase for me to care about a version of python released a decade ago.

@HyukjinKwon
Copy link
Member

Yup, I am aware of the history for Python 2.x and that syntax is specific to 2.7. Note that old OS already has 2.6 built-in Python and probably 2.6 wouldn't be newly installed on purpose much. In my previous company, there were thousands of customers relying on it. I personally think It needs another decade to ignore and push away Python 2.6.

I would be fine if there's better cases that could be fixed by something Python 2.7 has specifically but was less sure of these since there's a (unofficial) cost and risk we should take here.

For clarification, I am okay if anyone feels fine with it. I don't get in the way. It's -0 from me (Apache way).

@HyukjinKwon HyukjinKwon merged commit 9a32a6d into cloudpipe:master May 3, 2018
@HyukjinKwon
Copy link
Member

I have just merged. Thanks @alok and @llllllllll.

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.

4 participants