-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
colorama stubs #5108
colorama stubs #5108
Conversation
Um, actually I looked at the code again. There's a class called AnsiCodes. The way it's built, the class has its attributes as int but every specific instance has them as string (converted in init. How would you suggest handling this? |
I would add a comment about it and let them be strings, since most people presumably want to use them as strings. @srittau @hauntsaninja any thoughts?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have a few small comments.
For the int/str problem, it looks like users would normally just access the str values, so it makes sense to put those in the types. If it becomes an issue we could use Any
instead.
Did colorama refused to add types directly to it? I kinda prefer to see type hints directly in the libs but even stubs here are far better than nothing, especially for a popular library like colorama. |
Well... that's somewhat of a faux pas on my part. Let me ask. sorry for the
trouble.
…On Sat, Mar 27, 2021 at 2:43 PM Sorin Sbarnea ***@***.***> wrote:
Did colorama refused to add types directly to it? I kinda prefer to see
type hints directly in the libs but even stubs here are far better than
nothing, especially for a popular library like colorama.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5108 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYQXXNLOV7HURKGIDD7CXLTFXAF5ANCNFSM4ZBKIRFQ>
.
|
@haakenlid Ask, the answer is not always positive but it would make it easier to maintain. A major stopper was so far support for old pythons but as soon a library starts to require >= py36, it makes sense to add type directly to the code. |
There's this: I defer to your judgement about this. What should I push for? |
It's fine to just add stubs if the library author is not responsive or not willing to add types. In general we want to make it easier to distribute stubs through typeshed. |
As I've noticed you usually welcome stubs for pypi packages, I didn't open an issue and just open a pull request as these are new stubs for the colorama package.
I think they are pretty full (not a big package).
Any input is welcome.