File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1325,10 +1325,10 @@ class IntegerFormatter(StrMethodFormatter):
1325
1325
``integer=True``.
1326
1326
"""
1327
1327
def __init__ (self , fmt , unsigned = False , bits = None ):
1328
- self .unsigned = unsigned
1328
+ self ._unsigned = bool ( unsigned )
1329
1329
if bits is not None :
1330
1330
bits = int (bits )
1331
- self .bits = bits
1331
+ self ._bits = bits
1332
1332
super (IntegerFormatter , self ).__init__ (fmt )
1333
1333
1334
1334
def transform (self , x ):
@@ -1342,13 +1342,14 @@ def transform(self, x):
1342
1342
Returns the transformed number.
1343
1343
"""
1344
1344
x = int (x )
1345
- if x < 0 and self .unsigned :
1346
- bits = (- x ).bit_length () if self .bits is None else self .bits
1345
+ if x < 0 and self ._unsigned :
1346
+ bits = (- x ).bit_length () if self ._bits is None else self ._bits
1347
1347
x = x & ((1 << bits ) - 1 )
1348
1348
return x
1349
1349
1350
1350
def __call__ (self , x , pos = None ):
1351
- return super (IntegerFormatter , self ).__call__ (self .transform (x ), pos )
1351
+ return super (IntegerFormatter , self ).__call__ (x = self .transform (x ),
1352
+ pos = pos )
1352
1353
1353
1354
1354
1355
class LinearScaleFormatter (Formatter ):
You can’t perform that action at this time.
0 commit comments