File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 1818 timezone ,
1919)
2020from typing import (
21+ TYPE_CHECKING ,
2122 Any ,
2223 Callable ,
2324 Dict ,
@@ -693,18 +694,20 @@ def __repr__(self) -> str:
693694 ]
694695 return f"{ self .__class__ .__name__ } ({ ', ' .join (parts )} )"
695696
696- def __getattribute__ (self , name : str ) -> Any :
697- """
698- Lazily initialize default values to avoid infinite recursion for recursive
699- message types
700- """
701- value = super ().__getattribute__ (name )
702- if value is not PLACEHOLDER :
703- return value
697+ if not TYPE_CHECKING :
704698
705- value = self ._get_field_default (name )
706- super ().__setattr__ (name , value )
707- return value
699+ def __getattribute__ (self , name : str ) -> Any :
700+ """
701+ Lazily initialize default values to avoid infinite recursion for recursive
702+ message types
703+ """
704+ value = super ().__getattribute__ (name )
705+ if value is not PLACEHOLDER :
706+ return value
707+
708+ value = self ._get_field_default (name )
709+ super ().__setattr__ (name , value )
710+ return value
708711
709712 def __setattr__ (self , attr : str , value : Any ) -> None :
710713 if attr != "_serialized_on_wire" :
You can’t perform that action at this time.
0 commit comments