AThePeanut4 / docify

A script to add docstrings to Python type stubs using reflection
MIT License
5 stars 2 forks source link

Use modern type annotation for py38 #7

Closed jfcherng closed 1 week ago

jfcherng commented 1 week ago

With from __future__ import annotations, type annotation won't be evaluated at runtime so you can use | in type annotation in py38.

AThePeanut4 commented 1 week ago

The absolute type check with type() was intentional, docstrings should be normal strs, but eh a subclass is probably fine.

As for the __future__ import, I was going to use that, but I was initially trying to make python 3.6 work, which doesn't support it. Python 3.6 ended up breaking a ton of stuff though (and is no longer supported anyway) so I only made 3.9 work initially, adding 3.8 support later.

Thanks for the PR :+1: