8000 PR for beginner issue #17036 by Snehaaa24 · Pull Request #18461 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

PR for beginner issue #17036 #18461

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 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions misc/analyze_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def pluck(name: str, chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:


def report_counter(counter: Counter[str], amount: int | None = None) -> None:
if amount is None:
amount = len(counter) # default to the length of the counter if `amount` is None
for name, count in counter.most_common(amount):
print(f" {count: <8} {name}")
print()
Expand Down
3 changes: 1 addition & 2 deletions mypy/mro.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def linearize_hierarchy(
return info.mro
bases = info.direct_base_classes()
if not bases and info.fullname != "builtins.object" and obj_type is not None:
# Probably an error, add a dummy `object` base class,
# otherwise MRO calculation may spuriously fail.
# If no base classes are found, and obj_type is provided, we use obj_type to provide a base.
bases = [obj_type().type]
lin_bases = []
for base in bases:
Expand Down
Loading
0