Includes decorator "@typecheck" to provide type check on run-time.
Project description
Typechecker
Functionality:
- Compare typehints against args
- Compare typehints against key-word args
- Check parent classes for non-matching type
Works for both functions and class methods.
class Foo:
@typecheck
def bar(self, baz: str) -> None:
print(baz)
foo = Foo()
foo.bar("baz")
# baz
foo.bar(1)
# TypeError: Check function/method input-type(s)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytypechecker-1.0.4.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytypechecker-1.0.4.tar.gz.
File metadata
- Download URL: pytypechecker-1.0.4.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62228aef2f9097406655fe5444977861f7f582252cde9aefc783f9e39b4d7f14
|
|
| MD5 |
ba20556a56e827aabd7f0547737da67b
|
|
| BLAKE2b-256 |
a89b23159203500f236a2450192e9d04223df7e241ee653cdbe84df363cfe29a
|
File details
Details for the file pytypechecker-1.0.4-py3-none-any.whl.
File metadata
- Download URL: pytypechecker-1.0.4-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4be8261ba2e25db59c0dd0600983573b68d6a92e260b8c5b3fba8eeb06c55bf
|
|
| MD5 |
9076397c66bb2fc3a4c1580a63d01508
|
|
| BLAKE2b-256 |
4d7c406abcce11c93692e4ff6e168dc4102a7e801d6fe33a9ef62bd653cd832c
|