Opened 16 months ago
Closed 16 months ago
#26390 closed enhancement (fixed)
py3: some changes in misc
Reported by: | chapoton | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.4 |
Component: | python3 | Keywords: | |
Cc: | embray | Merged in: | |
Authors: | Erik Bray, Frédéric Chapoton | Reviewers: | Vincent Klein |
Report Upstream: | N/A | Work issues: | |
Branch: | a7fcc75 (Commits) | Commit: | a7fcc750ff28571d138ece4aeae18e6986f36921 |
Dependencies: | Stopgaps: |
Description (last modified by )
extracted from #26321
Change History (12)
comment:1 Changed 16 months ago by
- Branch set to public/26390
- Commit set to a7fcc750ff28571d138ece4aeae18e6986f36921
- Description modified (diff)
- Status changed from new to needs_review
comment:2 Changed 16 months ago by
- Owner changed from (none) to vklein
comment:3 Changed 16 months ago by
- sage: g = mypartial(f, 2, 3) + sage: g = mypartial(f, 2, 3) # py2; on Python 3 this is an error Traceback (most recent call last): ... DeprecationWarning: object.__init__() takes no parameters
Why not testing the error case with py3 ? And if it is not worth it why keeping the test in py2 ?
comment:4 Changed 16 months ago by
one should ask @embray, author of this
comment:5 Changed 16 months ago by
Because it's checking behavior that is no longer applicable on Python 3.
comment:6 follow-up: ↓ 8 Changed 16 months ago by
Ok.
I am also surprised by a doctests behaviour.
When i see this
sage: sage_input(long(-5), verify=True) # py2 # Verified -long(5) sage: sage_input(long(-7), preparse=False, verify=True) # Verified -7L sage: sage_input(long(11), preparse=None, verify=True) # py2 # Verified long(11)
i expect the second test to fail in python3 but it doesn't whith a sage -t --long src/sage/misc/sage_input.py
, what is the trick ?
comment:7 Changed 16 months ago by
- Owner changed from vklein to (none)
- Reviewers set to Vincent Klein
I am ok with this ticket, i will set it to positive review after green bot.
comment:8 in reply to: ↑ 6 Changed 16 months ago by
Replying to vklein:
i expect the second test to fail in python3 but it doesn't whith a
sage -t --long src/sage/misc/sage_input.py
, what is the trick ?
There are some tricks in the doctest parser for massaging differences between Python 2 and 3 w.r.t. to the Python 2 long type. For example, the L
-suffix is just ignored on Python 3 as long as the preceding numerals are the same.
But I don't think the Sage pre-parser will take long(1)
and output long(1)
on Python 3. So there are a few exceptions. But the majority of long-related tests work on Python 3.
comment:9 Changed 16 months ago by
Ok, thank you for clarifying that.
comment:10 Changed 16 months ago by
- Status changed from needs_review to positive_review
comment:11 Changed 16 months ago by
comment:12 Changed 16 months ago by
- Branch changed from public/26390 to a7fcc750ff28571d138ece4aeae18e6986f36921
- Resolution set to fixed
- Status changed from positive_review to closed
New commits:
various py3 changes in misc