@@ -1325,7 +1325,6 @@ def parser_body(
1325
1325
cpp_endif = "#endif /* " + conditional + " */"
1326
1326
1327
1327
assert clinic is not None
1328
- assert f .full_name is not None
1329
1328
if methoddef_define and f .full_name not in clinic .ifndef_symbols :
1330
1329
clinic .ifndef_symbols .add (f .full_name )
1331
1330
methoddef_ifndef = normalize_snippet ("""
@@ -1541,11 +1540,8 @@ def render_function(
1541
1540
'{impl_parameters}' in templates ['parser_prototype' ]):
1542
1541
data .declarations .pop (0 )
1543
1542
1544
- template_dict = {}
1545
-
1546
- assert isinstance (f .full_name , str )
1547
1543
full_name = f .full_name
1548
- template_dict [ 'full_name' ] = full_name
1544
+ template_dict = { 'full_name' : full_name }
1549
1545
1550
1546
if new_or_init :
1551
1547
assert isinstance (f .cls , Class )
@@ -2398,10 +2394,10 @@ def __repr__(self) -> str:
2398
2394
@dc .dataclass (repr = False )
2399
2395
class Class :
2400
2396
name : str
2401
- module : Module | None = None
2402
- cls : Class | None = None
2403
- typedef : str | None = None
2404
- type_object : str | None = None
2397
+ module : Module
2398
+ cls : Class | None
2399
+ typedef : str
2400
+ type_object : str
2405
2401
2406
2402
def __post_init__ (self ) -> None :
2407
2403
self .parent = self .cls or self .module
@@ -2527,14 +2523,14 @@ class Function:
2527
2523
_ : dc .KW_ONLY
2528
2524
name : str
2529
2525
module : Module
2530
- cls : Class | None = None
2531
- c_basename : str | None = None
2532
- full_name : str | None = None
2526
+ cls : Class | None
2527
+ c_basename : str | None
2528
+ full_name : str
2533
2529
return_converter : CReturnConverter
2530
+ kind : FunctionKind
2531
+ coexist : bool
2534
2532
return_annotation : object = inspect .Signature .empty
2535
2533
docstring : str = ''
2536
- kind : FunctionKind = CALLABLE
2537
- coexist : bool = False
2538
2534
# docstring_only means "don't generate a machine-readable
2539
2535
# signature, just a normal docstring". it's True for
2540
2536
# functions with optional groups because we can't represent
@@ -5325,7 +5321,6 @@ def state_function_docstring(self, line: str | None) -> None:
5325
5321
def format_docstring (self ) -> str :
5326
5322
f = self .function
5327
5323
assert f is not None
5328
- assert f .full_name is not None
5329
5324
5330
5325
new_or_init = f .kind .new_or_init
5331
5326
if new_or_init and not f .docstring :
0 commit comments