{"id":20749129,"url":"https://github.com/rafaelmachadobr/type-annotations","last_synced_at":"2026-06-04T17:31:12.727Z","repository":{"id":150009158,"uuid":"546727663","full_name":"rafaelmachadobr/type-annotations","owner":"rafaelmachadobr","description":"Este repositório é uma coleção de exemplos de uso de anotações de tipo em Python. As anotações de tipo são uma forma de informar o tipo de uma variável ou função em um programa Python, o que pode ajudar a evitar erros e facilitar a depuração.","archived":false,"fork":false,"pushed_at":"2022-12-27T19:03:02.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T03:25:21.059Z","etag":null,"topics":["python","type-annotations"],"latest_commit_sha":null,"homepage":"","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/rafaelmachadobr.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":"2022-10-06T14:45:51.000Z","updated_at":"2022-12-27T18:58:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ec37484-2fc0-4de3-beef-e932a275b4de","html_url":"https://github.com/rafaelmachadobr/type-annotations","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/rafaelmachadobr%2Ftype-annotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmachadobr%2Ftype-annotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmachadobr%2Ftype-annotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmachadobr%2Ftype-annotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelmachadobr","download_url":"https://codeload.github.com/rafaelmachadobr/type-annotations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243048119,"owners_count":20227592,"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":["python","type-annotations"],"created_at":"2024-11-17T08:21:10.279Z","updated_at":"2026-06-04T17:31:12.694Z","avatar_url":"https://github.com/rafaelmachadobr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Type Annotations\n\nEste repositório contém exemplos de utilização de anotações de tipo em Python. As anotações de tipo são uma forma de adicionar informações de tipo aos códigos Python, permitindo que ferramentas como o Mypy possam realizar verificações de tipo estático.\n\n## Arquivos\n- **\"annotations.py\"**: contém exemplos de anotações de tipo em diversos contextos, como em funções, métodos e atributos de classe.\n- **\"typing.py\"**: mostra como utilizar o módulo **\"typing\"** para criar anotações de tipo mais complexas, como tipos genéricos e conjuntos de tipos.\n- **\"exceptions.py\"**: demonstra como anotar exceções lançadas por uma função.\n\n## Utilização\nPara utilizar as anotações de tipo nestes exemplos, é necessário ter o Mypy instalado. Ele pode ser instalado com o seguinte comando:\n\n```pip install mypy```\n\nEm seguida, basta rodar o Mypy passando o nome do arquivo como parâmetro para verificar as anotações de tipo:\n\n```mypy annotations.py```\n\nO Mypy irá verificar se os tipos estão sendo utilizados corretamente e apontar possíveis erros de tipagem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelmachadobr%2Ftype-annotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelmachadobr%2Ftype-annotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelmachadobr%2Ftype-annotations/lists"}