Skip to content

Type annotation pyi file and tests #1964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

smartsammler
Copy link
Contributor

Add the Shadow.pyi from python/typeshed#1554 to this repo and add

  • a stub for structs and
  • a stub for fusedtype.

Add a test using mypy to test the stub file used if the tag mypy is added.
Therefore add mypy to the test-requirements.txt.

Add the mypy tag to pure_py3 and an explicit type annotation for Struct2, because mypy does not automatically infer the type when the typedef function is called.

* `FusedType` for the PEP484's stub file
* run mypy against test modules tagged with `mypy`
* Add `mypy` as a tag to the `pure_py3.py` test module.
* Add type hint for MyStruct2 in pure_py3 test, because MyStruct2 is of type
  `cython.typedef` instead of `cython.StructType`, so one needs to explicitly
  provide its type.
@scoder
Copy link
Contributor

scoder commented Oct 29, 2017

Thanks. Since this is not complete and ready for merging yet, I've created an updated branch at #1965 for further improvements.

@scoder scoder closed this Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants