Generate the code that declares this property.
(self)
| 261 | ) |
| 262 | |
| 263 | def generate_decl(self): |
| 264 | """Generate the code that declares this property.""" |
| 265 | code = inline_doc(self.description) |
| 266 | if code: |
| 267 | code += "\n" |
| 268 | code += f"{self.py_name}: {self.py_annotation}" |
| 269 | if self.optional: |
| 270 | code += " = None" |
| 271 | return code |
| 272 | |
| 273 | def generate_to_json(self, dict_, use_self=True): |
| 274 | """Generate the code that exports this property to the specified JSON dict.""" |
no test coverage detected