@@ -121,7 +121,7 @@ def __format_exponential(self, arg: celtypes.Value, precision: int) -> str:
121121 raise celpy .CELEvalError (msg )
122122
123123 def __format_int (self , arg : celtypes .Value ) -> str :
124- if isinstance (arg , ( celtypes .IntType , celtypes .UintType , celtypes .DoubleType ) ):
124+ if isinstance (arg , celtypes .IntType | celtypes .UintType | celtypes .DoubleType ):
125125 result = self .__validate_number (arg )
126126 if result is not None :
127127 return result
@@ -133,7 +133,7 @@ def __format_int(self, arg: celtypes.Value) -> str:
133133 raise celpy .CELEvalError (msg )
134134
135135 def __format_hex (self , arg : celtypes .Value ) -> str :
136- if isinstance (arg , ( celtypes .IntType , celtypes .UintType ) ):
136+ if isinstance (arg , celtypes .IntType | celtypes .UintType ):
137137 return f"{ arg :x} "
138138 if isinstance (arg , celtypes .BytesType ):
139139 return arg .hex ()
@@ -146,7 +146,7 @@ def __format_hex(self, arg: celtypes.Value) -> str:
146146 raise celpy .CELEvalError (msg )
147147
148148 def __format_oct (self , arg : celtypes .Value ) -> str :
149- if isinstance (arg , ( celtypes .IntType , celtypes .UintType ) ):
149+ if isinstance (arg , celtypes .IntType | celtypes .UintType ):
150150 return f"{ arg :o} "
151151 msg = (
152152 "error during formatting: octal clause can only be used on integers, was given "
@@ -155,7 +155,7 @@ def __format_oct(self, arg: celtypes.Value) -> str:
155155 raise celpy .CELEvalError (msg )
156156
157157 def __format_bin (self , arg : celtypes .Value ) -> str :
158- if isinstance (arg , ( celtypes .IntType , celtypes .UintType , celtypes .BoolType ) ):
158+ if isinstance (arg , celtypes .IntType | celtypes .UintType | celtypes .BoolType ):
159159 return f"{ arg :b} "
160160 msg = (
161161 "error during formatting: only integers and bools can be formatted as binary, was given "
0 commit comments