Skip to content

Removing python2.6 workarounds - #6153

Merged
bsipocz merged 3 commits into
astropy:masterfrom
bsipocz:python_26_33_cleanup
Jun 5, 2017
Merged

bsipocz merged 3 commits into
astropy:masterfrom
bsipocz:python_26_33_cleanup

Conversation

@bsipocz

@bsipocz bsipocz commented Jun 3, 2017

Copy link
Copy Markdown
Member

No description provided.

@bsipocz
bsipocz force-pushed the python_26_33_cleanup branch from 5ae8e47 to 678918a Compare June 3, 2017 17:39
@bsipocz bsipocz changed the title Removing python2.6 and python3.1 & 3.2 workarounds Removing python2.6 workarounds Jun 3, 2017
@bsipocz

bsipocz commented Jun 3, 2017

Copy link
Copy Markdown
Member Author

@taldcroft - Could you have a suggestion to revise this comment about python 3.1 and 3.2? https://github.com/astropy/astropy/blob/master/astropy/io/ascii/core.py#L144

I've removed that workaround looking subclassing, but that totally messed up all versions we support (2.7 & 3.4+)

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bad that we still had those in! One can be simplified even further...

Comment thread astropy/time/tests/test_basic.py Outdated
total_secs = lambda td: td.total_seconds()
total_secs = lambda td: td.total_seconds()

assert total_secs(dt) < 0.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can even just make this

assert td.total_seconds(dt) < 0.1

@bsipocz
bsipocz force-pushed the python_26_33_cleanup branch from 3c6e1dd to f2361f5 Compare June 4, 2017 10:51
@bsipocz
bsipocz force-pushed the python_26_33_cleanup branch from f2361f5 to 84661eb Compare June 4, 2017 11:22
@bsipocz

bsipocz commented Jun 4, 2017

Copy link
Copy Markdown
Member Author

@mhvk - Fixed. With 150K+ lines in astropy, no wonder a few of these always slip through.

@taldcroft

taldcroft commented Jun 4, 2017 •

Copy link
Copy Markdown
Member

@bsipocz - the code comment you referenced is now wrong, and the underlying issue is that np.ma.masked is not (yet) hashable, though I did argue again that it should. So I would suggest to just change the comment to be:

The constant ``numpy.ma.masked`` is not hashable (see https://github.com/numpy/numpy/issues/4660), 
so we need to  extend it here with a hash value.

@bsipocz
bsipocz merged commit dd2b168 into astropy:master Jun 5, 2017
@bsipocz
bsipocz deleted the python_26_33_cleanup branch September 16, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants