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