1- from typing import Any , Sequence , Union
1+ import typing
22
33from typing_extensions import Self
44
@@ -73,9 +73,9 @@ class PyJSONB:
7373
7474 def __init__ (
7575 self : Self ,
76- value : Union [
77- dict [str , Any ],
78- list [dict [str , Any ]],
76+ value : typing . Union [
77+ dict [str , typing . Any ],
78+ list [dict [str , typing . Any ]],
7979 ],
8080 ) -> None :
8181 """Create new instance of PyJSON.B.
@@ -91,9 +91,9 @@ class PyJSON:
9191
9292 def __init__ (
9393 self : Self ,
94- value : Union [
95- dict [str , Any ],
96- list [dict [str , Any ]],
94+ value : typing . Union [
95+ dict [str , typing . Any ],
96+ list [dict [str , typing . Any ]],
9797 ],
9898 ) -> None :
9999 """Create new instance of PyJSON.
@@ -124,77 +124,87 @@ class PyMacAddr8:
124124 - `value`: value for MACADDR8 field.
125125 """
126126
127+ Coordinates : typing .TypeAlias = typing .Union [
128+ list [int | float ],
129+ set [int | float ],
130+ tuple [int | float ],
131+ ]
132+
127133class PyPoint :
128134 """Represent point field in PostgreSQL and Point in Rust."""
129135
130136 def __init__ (
131137 self : Self ,
132- value : Sequence [ float ] ,
138+ value : Coordinates ,
133139 ) -> None :
134140 """Create new instance of PyPoint.
135141
136- It accepts any sequence of two float numbers.
142+ It accepts any pair(List, Tuple or Set)
143+ of int/float numbers in every combination.
137144
138145 ### Parameters:
139- - `value`: sequence of two float numbers.
146+ - `value`: pair of int/ float numbers in every combination .
140147 """
141148
142149class PyBox :
143150 """Represent box field in PostgreSQL and Rect in Rust."""
144151
145152 def __init__ (
146153 self : Self ,
147- value : Union [
148- Sequence [ Sequence [ float ]],
149- Sequence [ float ] ,
154+ value : typing . Union [
155+ typing . Union [ list [ Coordinates ], set [ Coordinates ], tuple [ Coordinates ]],
156+ Coordinates ,
150157 ],
151158 ) -> None :
152159 """Create new instance of PyBox.
153160
154161 You need to pass any of this structures:
155- - sequence of two sequences, each with pair of float numbers
156- - sequence of two pairs of float
162+ - sequence of two sequences,
163+ each with pair of int/float numbers in every combination
164+ - sequence of two pairs of int/float in every combination
157165
158166 ### Parameters:
159- - `value`: any valid sequence with two pairs of float numbers.
167+ - `value`: any valid sequence with two pairs
168+ of int/float numbers in every combination.
160169 """
161170
162171class PyPath :
163172 """Represent path field in PostgreSQL and LineString in Rust."""
164173
165174 def __init__ (
166175 self : Self ,
167- value : Union [
168- Sequence [ Sequence [ float ]],
169- Sequence [ float ] ,
176+ value : typing . Union [
177+ typing . Union [ list [ Coordinates ], set [ Coordinates ], tuple [ Coordinates ]],
178+ Coordinates ,
170179 ],
171180 ) -> None :
172181 """Create new instance of PyPath.
173182
174183 You need to pass any of this structures:
175- - sequence of sequences, each with pair of float numbers
176- - sequence with pairs of float numbers
184+ - sequence of sequences, each with pair of int/ float numbers in every combination
185+ - sequence with pairs of int/ float numbers in every combination
177186
178187 ### Parameters:
179- - `value`: any valid structure with float numbers.
188+ - `value`: any valid structure with int/ float numbers in every combination .
180189 """
181190
182191class PyLine :
183192 """Represent line field in PostgreSQL and Line in Rust."""
184193
185194 def __init__ (
186195 self : Self ,
187- value : Union [
188- Sequence [ Sequence [ float ]],
189- Sequence [ float ] ,
196+ value : typing . Union [
197+ typing . Union [ list [ Coordinates ], set [ Coordinates ], tuple [ Coordinates ]],
198+ Coordinates ,
190199 ],
191200 ) -> None :
192201 """Create new instance of PyLine.
193202
194203 You need to pass any of this structures:
195- - sequence of three float numbers
196- - sequence of two sequences, each with pair of float numbers
197- - sequence with two pairs of float numbers
204+ - sequence of three int/float numbers
205+ - sequence of two sequences,
206+ each with pair of int/float numbers in every combination
207+ - sequence with two pairs of int/float numbers in every combination
198208
199209 ### Parameters:
200210 - `value`: any valid structure with float numbers.
@@ -205,37 +215,38 @@ class PyLineSegment:
205215
206216 def __init__ (
207217 self : Self ,
208- value : Union [
209- Sequence [ Sequence [ float ]],
210- Sequence [ float ] ,
218+ value : typing . Union [
219+ typing . Union [ list [ Coordinates ], set [ Coordinates ], tuple [ Coordinates ]],
220+ Coordinates ,
211221 ],
212222 ) -> None :
213223 """Create new instance of PyLineSegment.
214224
215225 You need to pass any of this structures:
216- - sequence of two sequences, each with pair of float numbers
217- - sequence with two pairs of float numbers
226+ - sequence of two sequences,
227+ each with pair of int/float numbers in every combination
228+ - sequence with two pairs of int/float numbers in every combination
218229
219230 ### Parameters:
220- - `value`: any valid structure with float numbers.
231+ - `value`: any valid structure with int/ float numbers in every combination .
221232 """
222233
223234class PyPolygon :
224235 """Represent polygon field in PostgreSQL and Polygon in Rust."""
225236
226237 def __init__ (
227238 self : Self ,
228- value : Union [
229- Sequence [ Sequence [ float ]],
230- Sequence [ float ] ,
239+ value : typing . Union [
240+ typing . Union [ list [ Coordinates ], set [ Coordinates ], tuple [ Coordinates ]],
241+ Coordinates ,
231242 ],
232243 ) -> None :
233244 """Create new instance of PyPolygon.
234245
235246 You need to pass any of this structures:
236- - sequence of sequences, each with pair of float numbers
237- - sequence with pairs of float numbers
247+ - sequence of sequences, each with pair of int/ float numbers in every combination
248+ - sequence with pairs of int/ float numbers in every combination
238249
239250 ### Parameters:
240- - `value`: any valid structure with float numbers.
251+ - `value`: any valid structure with int/ float numbers in every combination .
241252 """
0 commit comments