MCPcopy
hub / github.com/hylang/hy / strip_digit_separators

Function strip_digit_separators

hy/models.py:307–314  ·  view source on GitHub ↗
(number)

Source from the content-addressed store, hash-verified

305
306
307def strip_digit_separators(number):
308 # Don't strip a _ or , if it's the first character, as _42 and
309 # ,42 aren't valid numbers
310 return (
311 number[0] + number[1:].replace("_", "").replace(",", "")
312 if isinstance(number, str) and len(number) > 1
313 else number
314 )
315
316
317class Integer(Object, int):

Callers 3

__new__Method · 0.85
__new__Method · 0.85
__new__Method · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected