@@ -61,9 +61,9 @@ class BaseSize(namedtuple("__BaseSize", "width, height")):
61
61
Base class namedtuple representing a page size, in point
62
62
63
63
:param width: The page width
64
- :type width: float
64
+ :type width: int, float, Decimal or Unit
65
65
:param height: The page height
66
- :type height: float
66
+ :type height: int, float, Decimal or Unit
67
67
"""
68
68
69
69
__slots__ : List [str ] = []
@@ -78,7 +78,7 @@ def __new__(cls, width: AnyNumber, height: AnyNumber):
78
78
cls ._unit (height ),
79
79
)
80
80
81
- def __str__ (self ):
81
+ def __str__ (self ) -> str :
82
82
return f"{ self .__class__ .__name__ } (width={ _rounders (self .width , '0' )} , height={ _rounders (self .height , '0' )} )"
83
83
84
84
@classmethod
@@ -162,9 +162,9 @@ class Size_mm(BaseSize):
162
162
representing a pagesize in millimeters.
163
163
164
164
:param width: The page width
165
- :type width: float
165
+ :type width: int, float, Decimal or Unit
166
166
:param height: The page height
167
- :type height: float
167
+ :type height: int, float, Decimal or Unit
168
168
"""
169
169
170
170
_unit = mm
@@ -176,9 +176,9 @@ class Size_inch(BaseSize):
176
176
representing a pagesize in inches.
177
177
178
178
:param width: The page width
179
- :type width: float
179
+ :type width: int, float, Decimal or Unit
180
180
:param height: The page height
181
- :type height: float
181
+ :type height: int, float, Decimal or Unit
182
182
"""
183
183
184
184
_unit = inch
@@ -190,9 +190,9 @@ class Size_cm(BaseSize):
190
190
representing a pagesize in centimeters.
191
191
192
192
:param width: The page width
193
- :type width: float
193
+ :type width: int, float, Decimal or Unit
194
194
:param height: The page height
195
- :type height: float
195
+ :type height: int, float, Decimal or Unit
196
196
"""
197
197
198
198
_unit = cm
@@ -204,9 +204,9 @@ class Size_um(BaseSize):
204
204
representing a pagesize in micrometers.
205
205
206
206
:param width: The page width
207
- :type width: float
207
+ :type width: int, float, Decimal or Unit
208
208
:param height: The page height
209
- :type height: float
209
+ :type height: int, float, Decimal or Unit
210
210
"""
211
211
212
212
_unit = um
@@ -218,9 +218,9 @@ class Size_pica(BaseSize):
218
218
representing a pagesize in pica.
219
219
220
220
:param width: The page width
221
- :type width: float
221
+ :type width: int, float, Decimal or Unit
222
222
:param height: The page height
223
- :type height: float
223
+ :type height: int, float, Decimal or Unit
224
224
"""
225
225
226
226
_unit = pica
@@ -232,9 +232,9 @@ class Size_didot(BaseSize):
232
232
representing a pagesize in didots / French Points.
233
233
234
234
:param width: The page width
235
- :type width: float
235
+ :type width: int, float, Decimal or Unit
236
236
:param height: The page height
237
- :type height: float
237
+ :type height: int, float, Decimal or Unit
238
238
"""
239
239
240
240
_unit = didot
@@ -246,9 +246,9 @@ class Size_cicero(BaseSize):
246
246
representing a pagesize in ciceros.
247
247
248
248
:param width: The page width
249
- :type width: float
249
+ :type width: int, float, Decimal or Unit
250
250
:param height: The page height
251
- :type height: float
251
+ :type height: int, float, Decimal or Unit
252
252
"""
253
253
254
254
_unit = cicero
@@ -260,9 +260,9 @@ class Size_new_didot(BaseSize):
260
260
representing a pagesize in new didots.
261
261
262
262
:param width: The page width
263
- :type width: float
263
+ :type width: int, float, Decimal or Unit
264
264
:param height: The page height
265
- :type height: float
265
+ :type height: int, float, Decimal or Unit
266
266
"""
267
267
268
268
_unit = new_didot
@@ -274,9 +274,9 @@ class Size_new_cicero(BaseSize):
274
274
representing a pagesize in ciceros.
275
275
276
276
:param width: The page width
277
- :type width: float
277
+ :type width: int, float, Decimal or Unit
278
278
:param height: The page height
279
- :type height: float
279
+ :type height: int, float, Decimal or Unit
280
280
"""
281
281
282
282
_unit = new_cicero
@@ -288,9 +288,9 @@ class Size_scaled_point(BaseSize):
288
288
representing a pagesize in scaled points.
289
289
290
290
:param width: The page width
291
- :type width: float
291
+ :type width: int, float, Decimal or Unit
292
292
:param height: The page height
293
- :type height: float
293
+ :type height: int, float, Decimal or Unit
294
294
"""
295
295
296
296
_unit = scaled_point
@@ -302,9 +302,9 @@ class PageSize(BaseSize):
302
302
representing a pagesize in point.
303
303
304
304
:param width: The page width
305
- :type width: float
305
+ :type width: int, float, Decimal or Unit
306
306
:param height: The page height
307
- :type height: float
307
+ :type height: int, float, Decimal or Unit
308
308
309
309
The pagesize can be converted to other units using the properties below.
310
310
"""
0 commit comments