Repository navigation
Update typeshed to 0abbaf725bf8439af222272e14326037fa5d4b2b - #11996
Bill Schnurr (bschnurr) merged 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Typeshed made datetime generic over tzinfo in python/typeshed#11844 (6e76a91ed3fc9a2c41b46ac6c3ae1673d0a3c2a1). The existing unparameterized annotation now displays as datetime[Any]. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
|
Reviewed commit: Result: 🔴 Verification detailsVerification: Automated verification is best effort. The PR author remains responsible for testing. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: C:\Program Files\RedHat\Podman\podman.EXE --connection pyrx-automation failed: stderr: Error: unable to start container "8268d270df1e6699119100ae60c83c03cf5a3ca9a2e21def4f5e65cc1705682e": crun: open `memory.max` for writing: No such file or directory: OCI runtime attempted to invoke a command that was not found Test runs: none recorded. |
Category A: python/typeshed#11844 (6e76a91ed3fc9a2c41b46ac6c3ae1673d0a3c2a1) loses datetime subclass identity and incorrectly infers an omitted combine timezone as None. python/typeshed#16811 fixes combine, but subclass preservation remains unresolved. Retain the exact pre-PR datetime stub and original OverloadCall1 reveal rather than carrying an incomplete generic migration. Add focused regression coverage for constructors, factories, combine timezone forms, and invalid arguments. Full suite: 3731 tests passed; lint and typecheck passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
3fa4803
into
microsoft:main
Upstream typeshed update
Update bundled typeshed from
7030b265d887eeacee07e47aa2cca412b07950c4to0abbaf725bf8439af222272e14326037fa5d4b2b.Upstream comparison.
Deferred datetime migration
Retain
stdlib/datetime.pyifrom the pre-PR baseline rather than importing the genericdatetimemigration from python/typeshed#11844:datetime.combine(day, aware_time)asdatetime[None], even though omittingtzinfopreserves the time's timezone. Explicittzinfo=Noneclears it.datetimeinstances statically, rejecting valid subclass-only methods.Typeshed corrected the omitted-argument overload in python/typeshed#16811 (
1084116c1a11dd8486242239bc914707e3e9fb2f), but its current stub still does not preserve subclass identity. Defer the migration as requested in review rather than carrying a speculative generic-stub redesign. The retained file matches the pre-PR Git blob exactly.Failure classification
datetimemigration.Pyright fixes
No analyzer changes. All other bundled typeshed updates remain in place.
Test updates
OverloadCall1expectation (datetime); the generic migration is no longer included.Datetime1to cover subclass constructors (positional and keyword timezones),now, related factories,replace,astimezone, andcombine.None(keyword and positional), and explicit timezone forms ofcombine, plus naive-time controls. Preserve conservativetzinfo | Noneinference rather than falsely promisingNone.Precision report
Preserve the pre-PR
datetimecontract: constructors and factories retain subclass identity, and timezone inference remains conservative. This intentionally defers the new timezone-specific generic precision until the upstream migration also preserves subclasses. No existing reveal expectations differ from the pre-PR baseline.Validation
Datetime1regression fails on reviewed HEAD0e651aa0294a33179c87dc00706ff339f8f83901(37 errors versus the two intended invalid-argument diagnostics).Datetime1andOverloadCall1tests pass after restoring the stub.pnpm --dir packages/pyright-internal test --maxWorkers=4): 99 suites passed, 1 skipped; 3,731 tests passed, 12 skipped; no failures. Jest reported a worker-teardown warning; the command exited successfully.pnpm run check: passed (syncpack, ESLint, Prettier).pnpm run typecheck: passed.git diff --check: passed.