andreas-abel / uiCA

uops.info Code Analyzer
GNU Affero General Public License v3.0
230 stars 16 forks source link

Python3 and style #4

Closed adsharma closed 3 years ago

adsharma commented 3 years ago

Had a few questions:

andreas-abel commented 3 years ago

For compatibility with Python 3.6 (the default on Ubuntu 18.04), I will not use dataclasses; typing.NamedTuple also offers type safety.

Regex strings do not need to be raw strings (in particular not if they contain no escape sequences).

adsharma commented 3 years ago

Regex strings do not need to be raw strings (in particular not if they contain no escape sequences).

flake8 is more explicit:

x64_lib.py:241:23: W605 invalid escape sequence '+' x64_lib.py:241:41: W605 invalid escape sequence '[' x64_lib.py:241:47: W605 invalid escape sequence ']'

adsharma commented 3 years ago

https://pypi.org/project/dataclasses/ have been backported to 3.6 and indentation of 3 spaces is weird.