@@ -1598,7 +1598,14 @@ def var_operation( # pyright: ignore [reportOverlappingOverload]
15981598
15991599@overload
16001600def var_operation (
1601- func : Callable [P , CustomVarOperationReturn [bool ]],
1601+ func : Callable [P , CustomVarOperationReturn [None ]],
1602+ ) -> Callable [P , NoneVar ]: ...
1603+
1604+
1605+ @overload
1606+ def var_operation ( # pyright: ignore [reportOverlappingOverload]
1607+ func : Callable [P , CustomVarOperationReturn [bool ]]
1608+ | Callable [P , CustomVarOperationReturn [bool | None ]],
16021609) -> Callable [P , BooleanVar ]: ...
16031610
16041611
@@ -1607,13 +1614,15 @@ def var_operation(
16071614
16081615@overload
16091616def var_operation (
1610- func : Callable [P , CustomVarOperationReturn [NUMBER_T ]],
1617+ func : Callable [P , CustomVarOperationReturn [NUMBER_T ]]
1618+ | Callable [P , CustomVarOperationReturn [NUMBER_T | None ]],
16111619) -> Callable [P , NumberVar [NUMBER_T ]]: ...
16121620
16131621
16141622@overload
16151623def var_operation (
1616- func : Callable [P , CustomVarOperationReturn [str ]],
1624+ func : Callable [P , CustomVarOperationReturn [str ]]
1625+ | Callable [P , CustomVarOperationReturn [str | None ]],
16171626) -> Callable [P , StringVar ]: ...
16181627
16191628
@@ -1622,7 +1631,8 @@ def var_operation(
16221631
16231632@overload
16241633def var_operation (
1625- func : Callable [P , CustomVarOperationReturn [LIST_T ]],
1634+ func : Callable [P , CustomVarOperationReturn [LIST_T ]]
1635+ | Callable [P , CustomVarOperationReturn [LIST_T | None ]],
16261636) -> Callable [P , ArrayVar [LIST_T ]]: ...
16271637
16281638
@@ -1631,13 +1641,15 @@ def var_operation(
16311641
16321642@overload
16331643def var_operation (
1634- func : Callable [P , CustomVarOperationReturn [OBJECT_TYPE ]],
1644+ func : Callable [P , CustomVarOperationReturn [OBJECT_TYPE ]]
1645+ | Callable [P , CustomVarOperationReturn [OBJECT_TYPE | None ]],
16351646) -> Callable [P , ObjectVar [OBJECT_TYPE ]]: ...
16361647
16371648
16381649@overload
16391650def var_operation (
1640- func : Callable [P , CustomVarOperationReturn [T ]],
1651+ func : Callable [P , CustomVarOperationReturn [T ]]
1652+ | Callable [P , CustomVarOperationReturn [T | None ]],
16411653) -> Callable [P , Var [T ]]: ...
16421654
16431655
@@ -3278,53 +3290,71 @@ def __set__(self, instance: Any, value: FIELD_TYPE):
32783290 """
32793291
32803292 @overload
3281- def __get__ (self : Field [bool ], instance : None , owner : Any ) -> BooleanVar : ...
3293+ def __get__ (self : Field [None ], instance : None , owner : Any ) -> NoneVar : ...
32823294
32833295 @overload
32843296 def __get__ (
3285- self : Field [int ] | Field [float ] | Field [ int | float ], instance : None , owner : Any
3286- ) -> NumberVar : ...
3297+ self : Field [bool ] | Field [bool | None ], instance : None , owner : Any
3298+ ) -> BooleanVar : ...
32873299
32883300 @overload
3289- def __get__ (self : Field [str ], instance : None , owner : Any ) -> StringVar : ...
3301+ def __get__ (
3302+ self : Field [int ]
3303+ | Field [float ]
3304+ | Field [int | float ]
3305+ | Field [int | None ]
3306+ | Field [float | None ]
3307+ | Field [int | float | None ],
3308+ instance : None ,
3309+ owner : Any ,
3310+ ) -> NumberVar : ...
32903311
32913312 @overload
3292- def __get__ (self : Field [None ], instance : None , owner : Any ) -> NoneVar : ...
3313+ def __get__ (
3314+ self : Field [str ] | Field [str | None ], instance : None , owner : Any
3315+ ) -> StringVar : ...
32933316
32943317 @overload
32953318 def __get__ (
3296- self : Field [list [V ]] | Field [set [V ]],
3319+ self : Field [list [V ]]
3320+ | Field [set [V ]]
3321+ | Field [list [V ] | None ]
3322+ | Field [set [V ] | None ],
32973323 instance : None ,
32983324 owner : Any ,
32993325 ) -> ArrayVar [Sequence [V ]]: ...
33003326
33013327 @overload
33023328 def __get__ (
3303- self : Field [SEQUENCE_TYPE ],
3329+ self : Field [SEQUENCE_TYPE ] | Field [ SEQUENCE_TYPE | None ] ,
33043330 instance : None ,
33053331 owner : Any ,
33063332 ) -> ArrayVar [SEQUENCE_TYPE ]: ...
33073333
33083334 @overload
33093335 def __get__ (
3310- self : Field [MAPPING_TYPE ], instance : None , owner : Any
3336+ self : Field [MAPPING_TYPE ] | Field [MAPPING_TYPE | None ],
3337+ instance : None ,
3338+ owner : Any ,
33113339 ) -> ObjectVar [MAPPING_TYPE ]: ...
33123340
33133341 @overload
33143342 def __get__ (
3315- self : Field [BASE_TYPE ], instance : None , owner : Any
3343+ self : Field [BASE_TYPE ] | Field [ BASE_TYPE | None ] , instance : None , owner : Any
33163344 ) -> ObjectVar [BASE_TYPE ]: ...
33173345
33183346 @overload
33193347 def __get__ (
3320- self : Field [SQLA_TYPE ], instance : None , owner : Any
3348+ self : Field [SQLA_TYPE ] | Field [ SQLA_TYPE | None ] , instance : None , owner : Any
33213349 ) -> ObjectVar [SQLA_TYPE ]: ...
33223350
33233351 if TYPE_CHECKING :
33243352
33253353 @overload
33263354 def __get__ (
3327- self : Field [DATACLASS_TYPE ], instance : None , owner : Any
3355+ self : Field [DATACLASS_TYPE ] | Field [DATACLASS_TYPE | None ],
3356+ instance : None ,
3357+ owner : Any ,
33283358 ) -> ObjectVar [DATACLASS_TYPE ]: ...
33293359
33303360 @overload
0 commit comments