File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ pub fn generator(type_data: &[PythonBindType]) -> io::Result<()> {
125125 }
126126 RustType :: Option ( InnerOptionType :: Custom , type_name)
127127 | RustType :: Option ( InnerOptionType :: Box , type_name) => {
128- python_types . push ( format ! ( " Optional[{type_name}]") ) ;
128+ write_fmt ! ( file , " {variable_name}: Optional[{type_name}]") ;
129129
130130 let python_type = if type_name == "Float" {
131131 "Float | float"
@@ -134,8 +134,8 @@ pub fn generator(type_data: &[PythonBindType]) -> io::Result<()> {
134134 } else {
135135 type_name. as_str ( )
136136 } ;
137-
138- write_fmt ! ( file , " {variable_name}: Optional[{python_type}]") ;
137+
138+ python_types . push ( format ! ( " Optional[{python_type}]") ) ;
139139 }
140140 RustType :: Box ( inner_type) => {
141141 python_types. push ( inner_type. to_string ( ) ) ;
You can’t perform that action at this time.
0 commit comments