4 ms·
I don’t want to discourage the author, but this seems like a misguided use of decorators. Maybe there’s some scenario where it’s practical to do version checks
by goodside 5y ago
I don’t want to discourage the author, but this seems like a misguided use of decorators. Maybe there’s some scenario where it’s practical to do version checks only at function boundaries, but why limit yourself that? It’s already easy (and clear, and non-magical) to check sys.version yourself in an if-statement. You can do that inside a def block to modify a function slightly, or outside a def block if you truly need the function definition to change by version. Given that, I don’t see how this library adds enough value to justify it as a dependency.
The project should also maybe note that it doesn’t help at all with Python 2 compatibility. A newer Python user might assume it enables freely mixing Python 2 and Python 3 in the same file, but even without reading the code I’m pretty sure the library doesn’t (and couldn’t) support this.