-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: python/mypy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master@{1day}
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: python/mypy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 4 commits
- 12 files changed
- 4 contributors
Commits on Dec 11, 2025
-
[mypyc] Fix calling async methods through vectorcall (#20393)
Fixes mypyc/mypyc#1170 Fixed a bug introduced when adding the async function wrapper in 81eaa5d that would result in `TypeErrors` being raised when the wrapped function was called using the vectorcall protocol. The exception was caused by the wrapper keeping the `self` argument of methods in the `args` vector instead of extracting it to a separate c function argument. The called function would not expect the `self` argument to be part of `args` so it appeared as if too many arguments were passed.
Configuration menu - View commit details
-
Copy full SHA for 6adb7a4 - Browse repository at this point
Copy the full SHA 6adb7a4View commit details -
[mypyc] Add primitive for bytes.startswith (#20387)
Implements `bytes.startswith` in mypy. Potentially could be more efficient without relying on `memcmp` but not sure. Tested with the following benchmark code, which shows a ~6.3x performance improvement compared to standard Python: ``` import time def bench(prefix: bytes, a: list[bytes], n: int) -> int: i = 0 for x in range(n): for b in a: if b.startswith(prefix): i += 1 return i a = [b"foo", b"barasdfsf", b"foobar", b"ab", b"asrtert", b"sertyeryt"] n = 5 * 1000 * 1000 prefix = b"foo" bench(prefix, a, n) t0 = time.time() bench(prefix, a, n) td = time.time() - t0 print(f"{td}s") ``` Output: ``` $ python /tmp/bench.py 1.0015509128570557s $ python -c 'import bench' 0.154998779296875s ```Configuration menu - View commit details
-
Copy full SHA for 1cea058 - Browse repository at this point
Copy the full SHA 1cea058View commit details -
[mypyc] feat: use
get_expr_length_valueintranslate_len(#20074)Currently, `translate_len` can determine the length of an RTuple at compile time This PR extends this capability to all expressions supported by `get_expr_length_value` This will constant fold the code example displayed in mypyc/mypyc#1152 without waiting for the implementation of #19886 which has a few steps ahead of it Before: ```python def extend_and_specialize(items: list[dict[str, Any]]) -> None: types: Final[dict[str, Any]] = {i["name"]: i for i in items} types.update( { k[len("https://w3id.org/cwl/salad#") :]: v for k, v in types.items() if k.startswith("https://w3id.org/cwl/salad#") } ) ``` After: ```python def extend_and_specialize(items: list[dict[str, Any]]) -> None: types: Final[dict[str, Any]] = {i["name"]: i for i in items} types.update( { k[27 : ]: v for k, v in types.items() if k.startswith("https://w3id.org/cwl/salad#") } ) ``` Even after #19986, this will also work for some situations that constant folding cannot handle but `get_expr_length` can.
Configuration menu - View commit details
-
Copy full SHA for 34373e3 - Browse repository at this point
Copy the full SHA 34373e3View commit details -
Fix Typo
attr->attrs(#20400)In the example, `attrs` is used, even though `attr` is imported. Picking either one isn't important, but the code gives a runtime error when the other one is used.
Configuration menu - View commit details
-
Copy full SHA for 12d53f6 - Browse repository at this point
Copy the full SHA 12d53f6View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master@{1day}...master