-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Thanks for making this available -- it's a very clever package.
I've noticed that varname doesn't play well with type annotations. Minimal code to reproduce an error:
from varname import varname
class Foo:
def __init__(self):
self.id = varname()
foo: Foo = Foo()
# => varname.VarnameRetrievingError: Failed to retrieve the variable name.It also doesn't like Generic[T]:
from typing import Generic, TypeVar
T = TypeVar("T")
class Foo(Generic[T]):
def __init__(self):
self.id = varname()
foo = Foo[int]()
foo.id # => 'result'Are there any plans to support this better? I plead ignorance as to the complexity, admittedly, but it would be helpful for my use case.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request