33# Note that they are NOT used for pydifact itself, as the code that is used by
44# pydifact is created on the fly by the parser and is located in
55# syntax.xxx.{data|composite|messages}.py
6- import typing
6+
77from dataclasses import dataclass
88from typing import NamedTuple
99
@@ -31,7 +31,8 @@ def class_name(self) -> str:
3131
3232 @property
3333 def identifier (self ) -> str :
34- """Returns a Python identifier that can be used as accessor in a dataclass."""
34+ """Returns a Python identifier that can be used as an accessor in a
35+ dataclass."""
3536 return f"{ to_identifier (self .title )} "
3637
3738
@@ -69,7 +70,8 @@ def class_name(self) -> str:
6970
7071 @property
7172 def identifier (self ) -> str :
72- """Returns a Python identifier that can be used as accessor in a dataclass."""
73+ """Returns a Python identifier that can be used as an accessor in a
74+ dataclass."""
7375 return f"{ to_identifier (self .title )} "
7476
7577
@@ -88,12 +90,13 @@ class SegmentDataElementUsage(NamedTuple):
8890
8991 @property
9092 def identifier (self ) -> str :
91- """Returns a Python identifier that can be used as accessor in a dataclass."""
93+ """Returns a Python identifier that can be used as an accessor in a
94+ dataclass."""
9295 return f"{ to_identifier (self .element .title )} "
9396
9497
9598class SegmentInlineDataElementUsage (NamedTuple ):
96- """Usage of a top level data element within a segment."""
99+ """Usage of a top- level data element within a segment."""
97100
98101 element : DataElementSpec
99102 mandatory : bool
@@ -111,7 +114,8 @@ class SegmentCompositeElementUsage(NamedTuple):
111114
112115 @property
113116 def identifier (self ) -> str :
114- """Returns a Python identifier that can be used as accessor in a dataclass."""
117+ """Returns a Python identifier that can be used as an accessor in a
118+ dataclass."""
115119 return f"{ to_identifier (self .element .title )} "
116120
117121
@@ -140,7 +144,8 @@ class MessageSegmentUsage(NamedTuple):
140144
141145 @property
142146 def identifier (self ) -> str :
143- """Returns a Python identifier that can be used as accessor in a dataclass."""
147+ """Returns a Python identifier that can be used as an accessor in a
148+ dataclass."""
144149 return f"{ to_identifier (self .element .title )} "
145150
146151
0 commit comments