News for hackers. Stuff that matters.
Re:Lisp.py by rollcat on Wednesday July 20, 2022 @12:46PM (#32168464)
Looking at the usage of is_integer, personally I would write something like parse_integer(x: str) -> Optional[int], where the None variant represents a caught ValueError; this avoids parsing the integer twice but achieves basically the same effect (in a very similar style).

What would you propose as "more pythonic" here? Writing your own integer parsing code, by looking at the ASCII values of each character in the string?

There are no comments on this comment yet.