@@ -194,20 +194,21 @@ def parse_int32(
194194 string : str ,
195195 style : int ,
196196 unsigned : bool ,
197+ bitsize : int ,
197198 radix : int = 10 ,
198199) -> Int32 :
199200 """
200201 Parses a string representation of a 32-bit integer with F#-compatible semantics.
201- This function matches the behavior of int32.py parse function exactly.
202202
203203 Args:
204204 string: The string to parse
205205 style: NumberStyles flags controlling parsing behavior
206206 unsigned: Whether to treat the result as unsigned (u32)
207+ bitsize: The bit width of the target type (8, 16, or 32)
207208 radix: Default radix to use (defaults to 10)
208209
209210 Returns:
210- The parsed integer value as int
211+ The parsed integer value
211212
212213 Raises:
213214 ValueError: If the string is not in a valid format or value is out of range
@@ -218,20 +219,21 @@ def parse_int64(
218219 string : str ,
219220 style : int ,
220221 unsigned : bool ,
222+ bitsize : int ,
221223 radix : int = 10 ,
222224) -> Int64 :
223225 """
224226 Parses a string representation of a 64-bit integer with F#-compatible semantics.
225- This function matches the behavior of long.py parse function exactly.
226227
227228 Args:
228229 string: The string to parse
229230 style: NumberStyles flags controlling parsing behavior
230231 unsigned: Whether to treat the result as unsigned (u64)
232+ bitsize: The bit width (64)
231233 radix: Default radix to use (defaults to 10)
232234
233235 Returns:
234- The parsed integer value as int
236+ The parsed integer value
235237
236238 Raises:
237239 ValueError: If the string is not in a valid format or value is out of range
@@ -242,8 +244,8 @@ def try_parse_int32(
242244 string : str ,
243245 style : int ,
244246 unsigned : bool ,
247+ bitsize : int ,
245248 def_value : Any ,
246- radix : int = 10 ,
247249) -> bool :
248250 """
249251 Attempts to parse a 32-bit integer with F#-style try semantics.
@@ -252,8 +254,8 @@ def try_parse_int32(
252254 string: The string to parse
253255 style: NumberStyles flags controlling parsing behavior
254256 unsigned: Whether to treat the result as unsigned (u32)
257+ bitsize: The bit width of the target type (8, 16, or 32)
255258 def_value: Python object reference to store the result on success
256- radix: Default radix to use (defaults to 10)
257259
258260 Returns:
259261 True if parsing succeeded, False otherwise
@@ -264,8 +266,8 @@ def try_parse_int64(
264266 string : str ,
265267 style : int ,
266268 unsigned : bool ,
269+ bitsize : int ,
267270 def_value : Any ,
268- radix : int = 10 ,
269271) -> bool :
270272 """
271273 Attempts to parse a 64-bit integer with F#-style try semantics.
@@ -274,8 +276,8 @@ def try_parse_int64(
274276 string: The string to parse
275277 style: NumberStyles flags controlling parsing behavior
276278 unsigned: Whether to treat the result as unsigned (u64)
279+ bitsize: The bit width (64)
277280 def_value: Python object reference to store the result on success
278- radix: Default radix to use (defaults to 10)
279281
280282 Returns:
281283 True if parsing succeeded, False otherwise
0 commit comments