Skip to content

Commit f7d8a55

Browse files
CPython Developersyouknowone
authored andcommitted
Update enum from v3.14.3
1 parent c30deb2 commit f7d8a55

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/enum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def show_flag_values(value):
129129
def bin(num, max_bits=None):
130130
"""
131131
Like built-in bin(), except negative values are represented in
132-
twos-compliment, and the leading bit always indicates sign
132+
twos-complement, and the leading bit always indicates sign
133133
(0=positive, 1=negative).
134134
135135
>>> bin(10)
@@ -138,6 +138,7 @@ def bin(num, max_bits=None):
138138
'0b1 0101'
139139
"""
140140

141+
num = num.__index__()
141142
ceiling = 2 ** (num).bit_length()
142143
if num >= 0:
143144
s = bltns.bin(num + ceiling).replace('1', '0', 1)

0 commit comments

Comments
 (0)