-
-
Notifications
You must be signed in to change notification settings - Fork 701
Closed
Description
Consider this session:
bsd:padics was$ sage
----------------------------------------------------------------------
| Sage Version 3.2.1.alpha2, Release Date: 2008-11-26 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: Qp(7, print_mode="digits")(1/3)
...44444444444444444445
sage: padic_printing.sep('][')
sage: Qp(7, print_mode="digits")(1/3)
...44444444444444444445
sage: Qp(11, print_mode="digits")(1/3)
...73737373737373737374
sage: Qp(17, print_mode="digits")(1/3)
...B5B5B5B5B5B5B5B5B5B6
sage: Qp(97, print_mode="digits")(1/3)
...64][64][64][64][64][64][64][64][64][64][64][64][64][64][64][64][64][64][64][65
sage: Qp(7, print_mode="digits")(1/3)
...44444444444444444445
sage: Qp(389, print_mode="digits")(1/3)
...259][129][259][129][259][129][259][129][259][129][259][129][259][129][259][129][259][129][259][130
sage: padic_printing.sep('|')
sage: Qp(389, print_mode="digits")(1/3)
...259][129][259][129][259][129][259][129][259][129][259][129][259][129][259][129][259][129][259][130
sage: Qp(997, print_mode="digits")(1/3)
...664|664|664|664|664|664|664|664|664|664|664|664|664|664|664|664|664|664|664|665
sage: Qp(7, print_mode="digits")(1/3)
...44444444444444444445
sage: Qp(3, print_mode="digits")(1/3)
....1
sage: Qp(5, print_mode="digits")(1/3)
...31313131313131313132
Basically the print separator for p-adic fields depends on what the global padic_printing.sep(...) thing happens to have been set at when that field was first created. There seems to be absolutely no way to change it later. The dependence is also totally baffling? Why the hell does it change for 97 but not 17, 11, 7? WTF!?!
Solution -- make the frickin' separator a property of the field that must be passed in. Notice now that isn't even possible. totally get rid of this stupid padic_printing object.
sage: Qp(5, print_mode="digits", sep='|')
TypeError: Qp() got an unexpected keyword argument 'sep'
CC: @ncalexan
Component: number theory
Issue created by migration from https://trac.sagemath.org/ticket/4637