-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add Type Annotations #116
Comments
That would be very cool @hawkins. I'm not too familiar with the typing landscape at the moment, but it seems like If this is something you're willing to research, I'm open to adding it! |
Awesome, thanks! I'll circle back later this weekend once I know a little more about how this could best work. |
@hawkins are you still keen on creating this? |
Sorry! I was never clear on the best way to distribute types, but I think you can add a Here's what we use locally now, just from # Stubs for addict.addict (Python 3)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
class Dict(dict):
def __init__(__self: Any, *args: Any, **kwargs: Any) -> None: ...
def __setattr__(self, name: Any, value: Any) -> None: ...
def __setitem__(self, name: Any, value: Any) -> None: ...
def __add__(self, other: Any): ...
def __getattr__(self, item: Any): ...
def __missing__(self, name: Any): ...
def __delattr__(self, name: Any) -> None: ...
def to_dict(self): ...
def copy(self): ...
def deepcopy(self): ...
def __deepcopy__(self, memo: Any): ...
def update(self, *args: Any, **kwargs: Any) -> None: ...
def __getnewargs__(self): ...
def setdefault(self, key: Any, default: Optional[Any] = ...): ... There's obviously room to improve, i.e., Here's the bad news though, I'm not using this project in any active development I have anymore, so I can try to find the time, but we both see how that went last year when I was using it 😕 Sorry! I miss writing Python though, so we'll see if I can find the time with a potential quarantine upcoming. (🤞) |
Got it. I'm not actively using Python much these days either, so I'll close this until someone else needs/wants it. Thanks for using addict! |
Does up-voting on the top post counts until someone else wants it? I'd take the (Also, would you mind closing this as incomplete? 😄) |
Also, duplicate #147 |
It would be stellar if Addict had type annotations (maybe in a
.pyi
file next toaddict.py
?) such that we could use this in projects using pyre, mypy, pyright, pytype etc.I imagine this would be pretty simple to make since the functions so closely resemble a Dict's in the first place, but I don't know the best way to distribute these types (typeshed? .pyi?).
If this is something you're open to, I can write the types later and PR them or look more into how best to distribute them
The text was updated successfully, but these errors were encountered: