Implement complex literal formatting (#3186)

This commit is contained in:
Charlie Marsh 2023-02-23 14:09:33 -05:00 committed by GitHub
parent ac79bf4ee9
commit 32d165b7ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 12 deletions

View file

@ -46,8 +46,6 @@ y = 100(no)
-x = (123456789.123456789).hex()
-x = (123456789.123456789e123456789).real
-x = (123456789e123456789).conjugate()
-x = 123456789j.real
-x = 123456789.123456789j.__add__(0b1011.bit_length())
+x = 0.1.is_integer()
+x = 1.0.imag
+x = 1e1.imag
@ -55,15 +53,14 @@ y = 100(no)
+x = 123456789.123456789.hex()
+x = 123456789.123456789e123456789.real
+x = 123456789e123456789.conjugate()
+x = 123456789J.real
+x = 123456789.123456789J.__add__(0b1011.bit_length())
x = 123456789j.real
x = 123456789.123456789j.__add__(0b1011.bit_length())
x = 0xB1ACC.conjugate()
x = 0b1011.conjugate()
x = 0o777.real
-x = (0.000000006).hex()
-x = -100.0000j
+x = 0.000000006.hex()
+x = -100.0000J
x = -100.0000j
-if (10).real:
+if 10.real:
@ -86,13 +83,13 @@ x = 1e-1.real
x = 123456789.123456789.hex()
x = 123456789.123456789e123456789.real
x = 123456789e123456789.conjugate()
x = 123456789J.real
x = 123456789.123456789J.__add__(0b1011.bit_length())
x = 123456789j.real
x = 123456789.123456789j.__add__(0b1011.bit_length())
x = 0xB1ACC.conjugate()
x = 0b1011.conjugate()
x = 0o777.real
x = 0.000000006.hex()
x = -100.0000J
x = -100.0000j
if 10.real:
...