# Takayi
Type hints for python 2.X.
`takayi` means `high` in japanese.
## Usage
```python
from takayi.parser import Parser, typehints
parser = Parser()
# ==================================================
@typehints(parser)
def get_sum(x, y):
# type: (int, int) -> int
return x + y
_sum = get_sum(1, 2) # result should be 3
# takayi.exc.ParameterTypeError: Expect => [<type 'int'>, <type 'int'>], Actually => [<type 'int'>, <type 'str'>]
_err_sum = get_sum(1, 'hello')
# ==================================================
@typehints(parser)
def test(x, y=1):
# type: (int, y: int) -> int
return x + y
assert test(1, y=10) == 11
# ==================================================
class Node(object): pass
node = Node()
@typehints(parser, attach_cls=Node)
def get_node():
# type: () -> Node
return node
```
## TODO
- [x] Support kwargs type check
- [ ] More types. FYI: [pep484](https://www.python.org/dev/peps/pep-0484/)
Type hints for python 2.X.
`takayi` means `high` in japanese.
## Usage
```python
from takayi.parser import Parser, typehints
parser = Parser()
# ==================================================
@typehints(parser)
def get_sum(x, y):
# type: (int, int) -> int
return x + y
_sum = get_sum(1, 2) # result should be 3
# takayi.exc.ParameterTypeError: Expect => [<type 'int'>, <type 'int'>], Actually => [<type 'int'>, <type 'str'>]
_err_sum = get_sum(1, 'hello')
# ==================================================
@typehints(parser)
def test(x, y=1):
# type: (int, y: int) -> int
return x + y
assert test(1, y=10) == 11
# ==================================================
class Node(object): pass
node = Node()
@typehints(parser, attach_cls=Node)
def get_node():
# type: () -> Node
return node
```
## TODO
- [x] Support kwargs type check
- [ ] More types. FYI: [pep484](https://www.python.org/dev/peps/pep-0484/)
Metadata
Release files for takayi 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| takayi-0.3.3.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| takayi-0.3.3-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 12.2 kB
Release files / takayi-0.3.3.tar.gz
| Download URL | takayi-0.3.3.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
962f840929a64461801b1201d3f8a4654a064adda6937e5853cab9e945114dda
|
|
BLAKE2b-256 checksum How to use checksums |
618d552c797dc30ccbf94714e1e46b3bfd60037ba0628da76551319e395881e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / takayi-0.3.3-py2-none-any.whl
| Download URL | takayi-0.3.3-py2-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
69c0318b81f1efc223844bf49b10a28f8b7b65103e69229466cfc2e0925a6225
|
|
BLAKE2b-256 checksum How to use checksums |
9c283c0f8a92e60c430b3c00f163cbe3fee502bf3739bc5ea9bcb42a5381707e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for takayi 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.