[pyupgrade] Do not upgrade functional TypedDicts with private field names to the class-based syntax (UP013) (#16219)

This commit is contained in:
sobolevn 2025-02-18 16:03:27 +03:00 committed by GitHub
parent 66a0467305
commit d8e3fcca97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 3 deletions

View file

@ -46,3 +46,9 @@ MyType = TypedDict("MyType", dict())
X = TypedDict("X", {
"some_config": int, # important
})
# Private names should not be reported (OK)
WithPrivate = TypedDict("WithPrivate", {"__x": int})
# Dunder names should not be reported (OK)
WithDunder = TypedDict("WithDunder", {"__x__": int})