3 ms·
Please don’t use assert for validation [1]. Just explicitly raise an exception instead, as Python can strip asserts and an AssertionError is a crap thing to hav
by orf 5y ago
Please don’t use assert for validation [1]. Just explicitly raise an exception instead, as Python can strip asserts and an AssertionError is a crap thing to have to catch.
In Python you almost never have to do “for i in range(len(…))”, just do “for path in file_path” [2].
1. https://github.com/yazeed44/gjf/blob/b85f4e58fe6ed84b5d2f8131acc32dc894dcc592/src/gjf/geojson_fixer.py#L90 https://github.com/yazeed44/gjf/blob/b85f4e58fe6ed84b5d2f813...
2. https://github.com/yazeed44/gjf/blob/b85f4e58fe6ed84b5d2f8131acc32dc894dcc592/src/gjf/cli.py#L12 https://github.com/yazeed44/gjf/blob/b85f4e58fe6ed84b5d2f813...