(x: bytes | str)
| 49 | |
| 50 | |
| 51 | def _to_float(x: bytes | str) -> float: |
| 52 | # Some AFM files use "," instead of "." as decimal separator -- this |
| 53 | # shouldn't be ambiguous (unless someone is wicked enough to use "," as |
| 54 | # thousands separator...). |
| 55 | if isinstance(x, bytes): |
| 56 | # Encoding doesn't really matter -- if we have codepoints >127 the call |
| 57 | # to float() will error anyways. |
| 58 | x = x.decode('latin-1') |
| 59 | return float(x.replace(',', '.')) |
| 60 | |
| 61 | |
| 62 | def _to_str(x: bytes) -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…