Skip to content
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

Use TypeGuard in IsImplementation #92

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Use TypeGuard in IsImplementation #92

wants to merge 1 commit into from

Conversation

nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Mar 13, 2023

However due to python/mypy#4717, this breaks IsImplemenation with errors like this one:

Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]

Which is unfortunate.

Leaving this here in the hopes we can merge it once python/mypy#4717 gets fixed.

src/oop_ext/foundation/_tests/test_weak_ref.py:323: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/oop_ext/interface/_tests/test_interface.py:401: error: Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:404: error: Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:405: error: Only concrete class can be given where "Type[_InterfM4]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:408: error: Only concrete class can be given where "Type[_InterfM4]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:409: error: Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:413: error: Only concrete class can be given where "Type[_InterfM4]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:414: error: Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:419: error: Only concrete class can be given where "Type[_InterfM1]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:447: error: Only concrete class can be given where "Type[_InterfM1]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:450: error: Only concrete class can be given where "Type[_InterfM1]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:463: error: Only concrete class can be given where "Type[_InterfM1]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:609: error: Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]
src/oop_ext/interface/_tests/test_interface.py:610: error: Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]
Found 13 errors in 1 file (checked 40 source files)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

However due to python/mypy#4717, this breaks
IsImplemenation with errors like this one:

   Only concrete class can be given where "Type[_InterfM3]" is expected  [type-abstract]

Which is unfortunate.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

1 participant