pycairo icon indicating copy to clipboard operation
pycairo copied to clipboard

typing: Use Generic for Context

Open lovetox opened this issue 2 years ago • 2 comments

Currently Context.get_target() returns the abstract base class Surface. Making Context a Generic allows the type checker to remember the type that was passed to the Context at creation.

lovetox avatar Aug 20 '22 17:08 lovetox

Hm, the doc build checks if the annotations are correct? and probably cant handle TypeVar?

Don’t know how to fix this, maybe there is a command for the doc builder to not do this check on these classes?

lovetox avatar Aug 20 '22 17:08 lovetox

It may be worth opening an issue at https://github.com/sphinx-doc/sphinx/issues/ and see if they have any ideas.

stuaxo avatar Sep 15 '22 10:09 stuaxo

as for sphinx, you just have to reference it like _FileLike in the docs for example, so sphinx can link it. I can continue here if wanted.

lazka avatar Oct 16 '22 17:10 lazka

@lazka if by continue you mean finishing whatever is missing so this can be merged, this would be appreciated. Thanks

lovetox avatar Oct 16 '22 17:10 lovetox