Skip to content

Conversation

@gulshan-123
Copy link

@gulshan-123 gulshan-123 commented Dec 8, 2025

Fixes #41219
Currently, in the doctests, in print_mode = 'digits', the initial characters are ... which are treated as a wildcard entry in sphinx.
For example: The below doctest will pass even though the actual answer is ...0000000000000000005F

   sage: repr(Qp(17)(100))
   '...F'

Thus the current PR will decode ... using the unicode character , avoiding any wildcard matching thus preventing any bad error.

NOTE: I have currently not updated the docstring/warnings. will do so after review
But test has been added.

testing:

sage: padic_printing.mode('digits-unicode')
sage: repr(Qp(17)(100))
'…0000000000000000005F'
sage: padic_printing.mode('digits')
sage: repr(Qp(17)(100))
'...0000000000000000005F'

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Documentation preview for this PR (built with commit 9c033b5; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong
Copy link
Contributor

cxzhong commented Dec 12, 2025

Can you add a doctest

@cxzhong
Copy link
Contributor

cxzhong commented Dec 12, 2025

Looks OK

@gulshan-123
Copy link
Author

gulshan-123 commented Dec 12, 2025

Can you add a doctest

The doctest has already been added at line 140-142.

Looks OK

Thank you!
Should I update the docstring then?

@user202729
Copy link
Contributor

user202729 commented Dec 16, 2025

Should I update the docstring then?

better leave that to a subsequent pull request. You can create a new branch that builds on top of the commits here and open a new pull request.

Currently, in the doctests, in print_mode = 'digits', the initial characters are ... which are treated as a wildcard entry in sphinx.

Not in Sphinx, in Python doctest module.

@gulshan-123
Copy link
Author

You can create a new branch that builds on top of the commits here and open a new pull request.

Ok, Sure

@gulshan-123
Copy link
Author

gulshan-123 commented Dec 16, 2025

Thank you for the review!, I had completely missed that, now reordered the test to match the expected output in the doctest.

Also, since this PR was generally for the issue of ... as wildcard characters. In the new upcoming PR, should I also change the doctest to remove mode='digits' and replace it with mode='digits-unicode' tests. I will update the docs about the mode=digits-unicode in the new PR.

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.

Add print_mode='digits-unicode' to p-adic numbers

3 participants