Skip to content

Commit

Permalink
Added entry for typestring parser check tool (#1402)
Browse files Browse the repository at this point in the history
* Added typestring parser checker

* Updated some errors

* Update

* Checking if installation wokrs

* Trying again

* Updates

* Another Update

* Update pyproject.toml

* Update documentation.rst

* Update requirements.txt

* Update

* syntax highlighting should work?

* Update

* Reverted back

* Will this work?

* Update

* Still trying

* Update

* Update again

* Fixed the indentation issues

* Update

* updated code block

* Update again

* Update

* Update again with blackendocs

* Update documentation.rst

* Added skip option to doctests

* Added the link

* Update link
  • Loading branch information
Nikhil0504 committed May 7, 2021
1 parent 684065f commit 1746073
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/source/contributing/documentation.rst
Expand Up @@ -400,6 +400,25 @@ elements that are either a ``str`` or ``None``;
``(str, int)``; ``Tuple[:class:`int`, ...]`` for a tuple of variable
length with only integers.

.. note::
As a helper for tool for typesets, you can use `typestring-parser
<https://github.com/Dominik1123/typestring-parser>`_
which can be accessed by first installing it via ``pip`` - ``pip install typestring-parser`` and
then using ``from typestring_parser import parse``.

.. doctest::
:options: +SKIP

>>> from typestring_parser import parse
>>> parse("int")
<class 'int'>
>>> parse("int or str")
typing.Union[int, str]
>>> parse("list of str or str")
typing.Union[typing.List[str], str]
>>> parse("list of (int, str)")
typing.List[typing.Tuple[int, str]]


Adding type hints to functions and parameters
---------------------------------------------
Expand Down

0 comments on commit 1746073

Please sign in to comment.