Opened 3 years ago

Closed 3 years ago

#22292 closed enhancement (fixed)

py3 replace <type '*'> by <... '*'> in doctests for some *

Reported by: chapoton Owned by:
Priority: major Milestone: sage-7.6
Component: python3 Keywords:
Cc: tscrim, jmantysalo, jdemeyer Merged in:
Authors: Frédéric Chapoton Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: 4c8b79b (Commits) Commit: 4c8b79b9993b366e08f7366d09e1d45f2dd386f5
Dependencies: Stopgaps:

Description (last modified by chapoton)

here for * = tuple, float, dict, generator, function

part of #16085, towards py3

Change History (12)

comment:1 Changed 3 years ago by chapoton

  • Branch set to u/chapoton/22292
  • Commit set to 4c8b79b9993b366e08f7366d09e1d45f2dd386f5
  • Status changed from new to needs_review

This was done purely using bash commands such as

grep -rl "<type 'function" src/sage/ | xargs sed -i "s/<type 'function/<... 'function/g"

Let us wait for the bots to check that no doctest was broken.


New commits:

4c8b79bpy3 : replace <type '*'> by <... '*'> for *=dict, generator, function, etc

comment:2 Changed 3 years ago by chapoton

  • Description modified (diff)

comment:3 Changed 3 years ago by chapoton

  • Cc tscrim jmantysalo jdemeyer added

green bot, please review (easy one)

comment:4 follow-up: Changed 3 years ago by jhpalmieri

The changes make sense and I will be able to see whether it passes tests on my machine, but I won't be able to explicitly check that it does the right thing with Python3. Is that good enough for a positive review?

comment:5 Changed 3 years ago by jhpalmieri

I've also verified that there are no remaining instances of <type '* for *=function, float, dict, generator, tuple in sage/src.

comment:6 in reply to: ↑ 4 Changed 3 years ago by chapoton

Replying to jhpalmieri:

The changes make sense and I will be able to see whether it passes tests on my machine, but I won't be able to explicitly check that it does the right thing with Python3. Is that good enough for a positive review?

yes, that's good enough, for sure. Thanks for the review. This is preparation for python3, we are not yet at the stage where we can run sage in py3.

Bot is green, so this is certainly good to go.

comment:7 Changed 3 years ago by jhpalmieri

  • Reviewers set to John Palmieri
  • Status changed from needs_review to positive_review

comment:8 Changed 3 years ago by fbissey

Have you built the documentation after the change? There seem to be one ticket blocking the building of the documentation in https://github.com/vbraun/sage/compare/e901b1d912...59c3b04b68 A plot in generic_graph.py is failing. This is the only ticket touching that file - which doesn't necessarily mean much.

comment:9 Changed 3 years ago by jhpalmieri

The docs build for me.

comment:10 Changed 3 years ago by fbissey

Thanks. It is either a subtle problem on my setup or another ticket. Sorry for the noise.

comment:11 Changed 3 years ago by jhpalmieri

No problem. I don't think I had actually tested the documentation until you asked. I was relying on the bot, and it never hurts to build it in person.

comment:12 Changed 3 years ago by vbraun

  • Branch changed from u/chapoton/22292 to 4c8b79b9993b366e08f7366d09e1d45f2dd386f5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.