mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
Implement complex literal formatting (#3186)
This commit is contained in:
parent
ac79bf4ee9
commit
32d165b7ad
3 changed files with 48 additions and 12 deletions
|
@ -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:
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue