Skip to content

Fix __all__ & improve command signature#9

Merged
rec merged 2 commits intorec:mainfrom
disrupted:improve-typing
Oct 5, 2023
Merged

Fix __all__ & improve command signature#9
rec merged 2 commits intorec:mainfrom
disrupted:improve-typing

Conversation

@disrupted
Copy link
Contributor

not as fancy as the dynamic construction of __all__ but Pyright was complaining that the members aren't exported and this is not supported for dunder attributes
also wasn't able to get completion results for the @app.command decorator, so I expanded the *args, **kwargs in the signature

@rec rec force-pushed the main branch 2 times, most recently from fe4fd73 to 850b319 Compare October 5, 2023 10:15
@rec
Copy link
Owner

rec commented Oct 5, 2023

All right!

Thanks for doing this.

I patched it in to make sure it runs the tests. Wow, I'm still on Python 3.7 for this project, I can update it!


The first commit is unassuming and fine.

I now write (from reading the typing list a bit) import typing as t in all my new code, saves a huge amount of kerfuffle, I'll probably get rid of it in a bit.

The second is... horrifying :-D :-D

but does fix the issue at hand and seems to be the only possible solution given static type checking.

mypy still doesn't pass for various other reasons but I'll deal with those!


Thanks again, I'm pulling this as-is.

@rec rec merged commit 9743b9a into rec:main Oct 5, 2023
@rec
Copy link
Owner

rec commented Oct 5, 2023

I just released this as dtyper 2.2.0, let me know how it works out!

I am following an idea with the make_dataclass functionality based on some experiments.

@disrupted disrupted deleted the improve-typing branch October 5, 2023 10:42
@disrupted
Copy link
Contributor Author

thanks! Don't forget to create the tag + GitHub release for 2.2.0 as well 😉

@rec
Copy link
Owner

rec commented Oct 5, 2023

Done, I actually obsoleted Python 3.7 in a later commit so it's 2.3.1 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants