Conversation
Typing conformance results improved 🎉The percentage of diagnostics emitted that were expected errors increased from 87.72% to 87.75%. The percentage of expected errors that received a diagnostic increased from 82.85% to 82.88%. The number of fully passing files held steady at 74/132. SummaryHow are test cases classified?Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (
Test file breakdown1 file altered
Optional Diagnostics Added (2)2 diagnostics
|
|
Memory usage reportSummary
Significant changesClick to expand detailed breakdownflake8
trio
prefect
sphinx
|
dbb7622 to
da0c825
Compare
e3f84c6 to
5eae9a2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5eae9a2f9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5eae9a2 to
1baf73c
Compare
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
3 | 0 | 0 |
unresolved-attribute |
0 | 3 | 0 |
call-non-callable |
0 | 1 | 0 |
invalid-return-type |
1 | 0 | 0 |
| Total | 4 | 4 | 0 |
Raw diff:
core (https://github.com/home-assistant/core)
+ homeassistant/components/http/forwarded.py:213:33 error[invalid-argument-type] Argument to bound method `clone` is incorrect: Expected `Mapping[str, str] | Mapping[istr, str] | Iterable[tuple[str, str]] | _SENTINEL`, found `str`
+ homeassistant/components/http/forwarded.py:213:33 error[invalid-argument-type] Argument to bound method `clone` is incorrect: Expected `int | _SENTINEL`, found `str`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/vendor/psutil/_psposix.py:56:16 error[call-non-callable] Object of type `IntEnum` is not callable
- ddtrace/vendor/psutil/_pslinux.py:96:11 error[unresolved-attribute] Object of type `IntEnum` has no attribute `AF_LINK`
- ddtrace/vendor/psutil/_pswindows.py:82:11 error[unresolved-attribute] Object of type `IntEnum` has no attribute `AF_LINK`
discord.py (https://github.com/Rapptz/discord.py)
+ discord/http.py:571:53 error[invalid-argument-type] Argument to bound method `ws_connect` is incorrect: Expected `ClientWSTimeout | _SENTINEL`, found `ClientWSTimeout | float`
psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/enum.py:173:12 error[invalid-return-type] Return type does not match returned value: expected `Enum`, found `type[Enum]`
pybind11 (https://github.com/pybind/pybind11)
- tests/test_native_enum.py:117:41 error[unresolved-attribute] Object of type `IntEnum` has no attribute `mem`There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1baf73cfe0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 893448a30b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d41b7b9b4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3cc298d to
33a4cb3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33a4cb37a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25b76f106b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de88e98c1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d08281f5f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 996f83631b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d6af9dab3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thank you for working on this. I'm going to wait to review until we land functional TypedDict support (#24174) since we'll then need to rebase here and it may establish some useful patterns / precedents. |
1d6af9d to
0cb327a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cb327a20b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3390f5411c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3390f54 to
f7d9ce2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7d9ce23b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
758cda5 to
b3d444a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3d444afeb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b3d444a to
c31e542
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c31e5427a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Here's a diff with some tests demonstrating current behavior on this branch as compared to static (You don't need to commit these exact tests verbatim with the static We should review each case where we're diverging from static |
|
I'm wondering if the shape here should be closer to functional |
c31e542 to
3dd7d3a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dd7d3a8c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
truthfully i hadn't considered it - let me just make sure i understand for Line = TypedDict('Line', {'start': Point, 'end': Point})
Point = TypedDict('Point', {'x': int, 'y': int})for Color = Enum('Color', {'RED': BASE, 'GREEN': BASE + 1, 'BLUE': BASE + 2})
BASE = 10but to your point that's not a runtime-valid example either way, i'll defer to you - if there are other reasons to reimplement using deferred inference (consistency with still need to work through the static enum parity comment but otherwise i think i got the rest of the pr feedback |
3dd7d3a to
49a4939
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49a4939e7e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
As an example of deferred inference, you need to defer the fields to support cases like: Tree = TypedDict(
"Tree",
{
"value": int,
"left": "Tree | None",
"right": "Tree | None",
},
)So generally it's only needed to support type annotation on the right-hand side. It seems like the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bde7eb43b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
hmm i don't think it even takes an annotation - just a plain class object |
Summary
astral-sh/ty#876
https://typing.python.org/en/latest/spec/enums.html#enum-definition
this pr implements the functional syntax for creating enums:
Enum('Color2', 'RED, GREEN, BLUE')it mostly copies the
namedtupleimplementationit supports the
start=andtype=kwargs forEnumas well (docs)it also supports
FlagandIntFlagthe
ddtracediffs look to be correct -IntEnumcall is now properly recognizedfor non-string-literal
namearguments, it falls back to just returningtype[Enum]- this came up by way of a psycopg regression on this line - wasn't sure if this was better or worse than returning aDynamicEnumLiteralwith an unknown name and members.this now looks correct for psycopg:
+ psycopg/psycopg/types/enum.py:173:12 [error] [invalid-return-type] Return type does not match returned value: expectedEnum, foundtype[Enum]``however, it appears mypy does not correctly support the functional API (i am wondering if this is why the psycopg typing is the way it is), or maybe when just returning the result of the
Enumcall (without assigning it to a name), it always assumes its looking up a member:Test Plan
mdtests