@@ -42,7 +42,11 @@ class EuropeanArticleNumber13(Barcode):
4242 digits = 12
4343
4444 def __init__ (
45- self , ean : str , writer = None , no_checksum = False , guardbar = False
45+ self ,
46+ ean : str ,
47+ writer = None ,
48+ no_checksum : bool = False ,
49+ guardbar : bool = False ,
4650 ) -> None :
4751 if not ean [: self .digits ].isdigit ():
4852 raise IllegalCharacterError (f"EAN code can only contain numbers { ean } ." )
@@ -121,7 +125,7 @@ def to_ascii(self) -> str:
121125 code = code_list [0 ]
122126 return code .replace ("G" , "|" ).replace ("1" , "|" ).replace ("0" , " " )
123127
124- def render (self , writer_options = None , text = None ):
128+ def render (self , writer_options : dict | None = None , text : str | None = None ):
125129 options = {"module_width" : SIZES ["SC2" ]}
126130 options .update (writer_options or {})
127131 return super ().render (options , text )
@@ -161,11 +165,8 @@ def __init__(self, jan, *args, **kwargs) -> None:
161165class EuropeanArticleNumber8 (EuropeanArticleNumber13 ):
162166 """Represents an EAN-8 barcode. See EAN13's __init__ for details.
163167
164- :parameters:
165- ean : String
166- The ean number as string.
167- writer : barcode.writer Instance
168- The writer to render the barcode (default: SVGWriter).
168+ :param ean: The ean number as string.
169+ :param writer: The writer to render the barcode (default: SVGWriter).
169170 """
170171
171172 name = "EAN-8"
@@ -197,7 +198,13 @@ class EuropeanArticleNumber8WithGuard(EuropeanArticleNumber8):
197198
198199 name = "EAN-8 with guards"
199200
200- def __init__ (self , ean , writer = None , no_checksum = False , guardbar = True ) -> None :
201+ def __init__ (
202+ self ,
203+ ean : str ,
204+ writer = None ,
205+ no_checksum : bool = False ,
206+ guardbar : bool = True ,
207+ ) -> None :
201208 super ().__init__ (ean , writer , no_checksum , guardbar )
202209
203210
0 commit comments