Skip to content

Inferencing type reference of abstract class inferred from concrete type values #8096

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

Merged
merged 4 commits into from
Dec 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change comments
  • Loading branch information
TH3CHARLie committed Dec 7, 2019
commit 239fa1c463396147ca329e8597eb8dd4cce2c3a2
4 changes: 2 additions & 2 deletions mypy/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def visit_callable_type(self, t: CallableType) -> ProperType:
if is_equivalent(t, self.s):
return combine_similar_callables(t, self.s)
result = join_similar_callables(t, self.s)
# unless some or all items represent abstract objects,
# we set the flag: from_type_type to True
# We set the from_type_type flag to suppress error when a collection of
# concrete class objects gets inferred as their common abstract superclass.
if not ((t.is_type_obj() and t.type_object().is_abstract) or
(self.s.is_type_obj() and self.s.type_object().is_abstract)):
result.from_type_type = True
Expand Down
4 changes: 2 additions & 2 deletions mypy/meet.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ def visit_callable_type(self, t: CallableType) -> ProperType:
if is_equivalent(t, self.s):
return combine_similar_callables(t, self.s)
result = meet_similar_callables(t, self.s)
# unless some or all items represent abstract objects,
# we set the flag: from_type_type to True
# We set the from_type_type flag to suppress error when a collection of
# concrete class objects gets inferred as their common abstract superclass.
if not ((t.is_type_obj() and t.type_object().is_abstract) or
(self.s.is_type_obj() and self.s.type_object().is_abstract)):
result.from_type_type = True
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy