We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d301ff commit fa3ff1eCopy full SHA for fa3ff1e
1 file changed
src/docstub/_stubs.py
@@ -298,6 +298,16 @@ class Py2StubTransformer(cst.CSTTransformer):
298
References
299
----------
300
.. [1] Stub file specification https://typing.readthedocs.io/en/latest/spec/distributing.html#stub-files
301
+
302
+ Examples
303
+ --------
304
+ >>> from docstub._stubs import Py2StubTransformer
305
+ >>> transformer = Py2StubTransformer()
306
+ >>> source = 'def print_upper(x): print(x.upper())'
307
+ >>> stub = transformer.python_to_stub(source)
308
+ >>> print(stub)
309
+ from _typeshed import Incomplete
310
+ def print_upper(x: Incomplete) -> None: ...
311
"""
312
313
METADATA_DEPENDENCIES: ClassVar[tuple] = (cst.metadata.PositionProvider,)
0 commit comments