You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The platform module contains various version checks for systems such as cpython and ironpython. The file also contains a specfic case for ironpython 2.6 and 2.7 which can be removed (platform.py does not run with python2)
Removing the check improves the import speed as it avoids the compilation of a regular expression.
%timeit _ironpython26_sys_version_parser = re.compile(r'([\d.]+)\s*' r'\(IronPython\s*' r'[\d.]+\s*' r'\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)' )
383 ns ± 1.66 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
Bug report
The platform module contains various version checks for systems such as cpython and ironpython. The file also contains a specfic case for ironpython 2.6 and 2.7 which can be removed (platform.py does not run with python2)
Removing the check improves the import speed as it avoids the compilation of a regular expression.
Linked PRs
The text was updated successfully, but these errors were encountered: