{"id":16966116,"url":"https://github.com/aldanor/typo","last_synced_at":"2025-05-15T17:31:24.160Z","repository":{"id":73640966,"uuid":"72688003","full_name":"aldanor/typo","owner":"aldanor","description":"Runtime Type Checking in Python 3","archived":false,"fork":false,"pushed_at":"2016-11-07T08:43:25.000Z","size":80,"stargazers_count":28,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-14T00:02:58.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aldanor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-02T22:47:56.000Z","updated_at":"2024-04-30T11:01:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"a631f5e7-54be-4f06-ab49-82888c945e02","html_url":"https://github.com/aldanor/typo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldanor%2Ftypo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldanor%2Ftypo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldanor%2Ftypo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldanor%2Ftypo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldanor","download_url":"https://codeload.github.com/aldanor/typo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225365955,"owners_count":17462973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T00:02:51.371Z","updated_at":"2024-11-19T14:09:51.288Z","avatar_url":"https://github.com/aldanor.png","language":"Python","funding_links":[],"categories":["Programming Languages"],"sub_categories":[],"readme":"### typo\n\nThis package intends to provide run-time type checking for functions annotated \nwith argument type hints (standard library `typing` module in Python 3.5, or \n`backports.typing` package in Python 3.3 / 3.4).\n\nExample:\n\n```python\nfrom typing import Sequence, List\nfrom typo import type_check\n\n@type_check\ndef f(x: int, s: Sequence[int]) -\u003e List[int]:\n\t...\n```\n\nThe `@type_check` decorator ensures that the values passed to annotated\narguments will have their types checked before the function is executed;\nreturn value can be optionally checked as well. \n\nIf the value types are not consistent with the function signature, a \n`TypeError` with a descriptive error message will be raised. For\ninstance, calling function `f` from the example above with wrong \nargument types,\n\n```python\n\u003e\u003e\u003e f(1, (0, 2.2))\n```\n\nresults in an exception being thrown:\n\n```\nTypeError: invalid item #1 of `s`: expected int, got float\n```\n\n*Note:* this is work-in-progress and not all `typing` primitives are\nsupported; however all supported constructs should be covered by a\ngood number of tests.\n\nHere's some of the supported type hints: simple types, `List`, `Dict`,\n`Tuple`, `Sequence`, `Set`, `TypeVar` (with support for constraints \nand upper bounds).\n\nWhat's not supported: `Iterator` and `Generator` (which we can't\ninspect due to their laziness), `Callable` (which we can't check\nwithout calling it), forward references (which is possible to\nsupport but requires more work), covariant and contravariant\ntype variables (this requires more thought but isn't likely\nto be helpful in the runtime context).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldanor%2Ftypo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldanor%2Ftypo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldanor%2Ftypo/lists"}