Closed kimvais closed 12 months ago
What do you see as the advantage of making the version check based on the number rather than the attribute existing? I'd rather do it on the presence of the attribute in case something like PyPy hasn't implemented all of a new inspect
yet.
Well, I'm a strong believer that "Readability counts" is the most important piece of PEP 20 and in my opinion making any code less consistent (and therefore arguably less readable) because some third-party static analysis tool might not be up to speed is counterproductive.
But fair enough, no objection on changing the if clause back to what it was. I guess I got a bit distracted by the bit confusing comment :)
asyncio.iscoroutinefunction
would be needed as a fallback only for Python 3.4 as 3.3 didn't have asyncio and 3.5 introducedinspect.iscoroutinefunction
Also made the 3.12 version check explicit instead of implicit based on the existence of the decorator.