File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -482,28 +482,28 @@ def as_dict(self) -> Dict[str, Any]:
482482 output [n ] = self [i ]
483483 return output
484484
485- @staticmethod
486- def from_list (x : list ) -> "NamedList" :
485+ @classmethod
486+ def from_list (cls , x : list ) -> "NamedList" :
487487 """
488488 Args:
489489 x: List of data elements.
490490
491491 Returns:
492- A ``NamedList`` instance with the contents of ``x`` and no names.
492+ A instance with the contents of ``x`` and no names.
493493 """
494- return NamedList (x )
494+ return cls (x )
495495
496- @staticmethod
497- def from_dict (x : dict ) -> "NamedList" :
496+ @classmethod
497+ def from_dict (cls , x : dict ) -> "NamedList" :
498498 """
499499 Args:
500500 x: Dictionary where keys are strings (or can be coerced to them).
501501
502502 Returns:
503- A ``NamedList`` instance where the list elements are the values of
503+ A instance where the list elements are the values of
504504 ``x`` and the names are the stringified keys.
505505 """
506- return NamedList (list (x .values ()), names = Names (str (y ) for y in x .keys ()))
506+ return cls (list (x .values ()), names = Names (str (y ) for y in x .keys ()))
507507
508508
509509@subset_sequence .register
You can’t perform that action at this time.
0 commit comments