You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type checkers like mypy and Pylance have become ubiquitous in modern Python for quickly writing safe, bug-free code. They catch bugs coming from obscure corner cases that programmers often overlook. Without annotations, they often attempt to infer the signatures of functions.
However, there are come cases where type checkers are unable to infer them, including in graphviz, for example here:
importgraphvizdot=graphviz.Digraph(comment='Foo', format='png')
withdot.subgraph(name=f'cluster_Foo') asc: # Object of type "None" cannot be used with "with"# these all work fine:c.attr(label='foo')
c.attr(style='filled', color='lightgrey')
c.node_attr.update(style='filled', color='white')
c.node('bar')
Could you add type annotations for common functions and methods like Dot.subgraph() to disambiguate their signatures?
The text was updated successfully, but these errors were encountered:
Type checkers like mypy and Pylance have become ubiquitous in modern Python for quickly writing safe, bug-free code. They catch bugs coming from obscure corner cases that programmers often overlook. Without annotations, they often attempt to infer the signatures of functions.
However, there are come cases where type checkers are unable to infer them, including in graphviz, for example here:
Could you add type annotations for common functions and methods like
Dot.subgraph()
to disambiguate their signatures?The text was updated successfully, but these errors were encountered: