1- from typing import Any , Union
1+ import typing
22
33from typing_extensions import Self
44
@@ -91,9 +91,9 @@ class PyJSONB:
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.B.
@@ -109,9 +109,9 @@ class PyJSON:
109109
110110 def __init__ (
111111 self : Self ,
112- value : Union [
113- dict [str , Any ],
114- list [dict [str , Any ]],
112+ value : typing . Union [
113+ dict [str , typing . Any ],
114+ list [dict [str , typing . Any ]],
115115 ],
116116 ) -> None :
117117 """Create new instance of PyJSON.
@@ -144,3 +144,108 @@ class PyMacAddr8:
144144
145145class PyCustomType :
146146 def __init__ (self , value : bytes ) -> None : ...
147+
148+ Coordinates : typing .TypeAlias = typing .Union [
149+ list [int | float ],
150+ set [int | float ],
151+ tuple [int | float , int | float ],
152+ ]
153+ PairsOfCoordinates : typing .TypeAlias = typing .Union [
154+ list [Coordinates | int | float ],
155+ set [Coordinates | int | float ],
156+ tuple [Coordinates | int | float , ...],
157+ ]
158+
159+ class PyPoint :
160+ """Represent point field in PostgreSQL and Point in Rust."""
161+
162+ def __init__ (self : Self , value : Coordinates ) -> None :
163+ """Create new instance of PyPoint.
164+
165+ It accepts any pair(List, Tuple or Set)
166+ of int/float numbers in every combination.
167+
168+ ### Parameters:
169+ - `value`: pair of int/float numbers in every combination.
170+ """
171+
172+ class PyBox :
173+ """Represent box field in PostgreSQL and Rect in Rust."""
174+
175+ def __init__ (self : Self , value : PairsOfCoordinates ) -> None :
176+ """Create new instance of PyBox.
177+
178+ You need to pass any of this structures:
179+ - sequence(List, Tuple or Set) of two sequences(List, Tuple or Set),
180+ each with pair of int/float numbers in every combination
181+ - sequence(List, Tuple or Set) of two pairs of int/float in every combination
182+
183+ ### Parameters:
184+ - `value`: any valid sequence(List, Tuple or Set) with two pairs
185+ of int/float numbers in every combination.
186+ """
187+
188+ class PyPath :
189+ """Represent path field in PostgreSQL and LineString in Rust."""
190+
191+ def __init__ (self : Self , value : PairsOfCoordinates ) -> None :
192+ """Create new instance of PyPath.
193+
194+ You need to pass any of this structures:
195+ - sequence(List, Tuple or Set) of sequences(List, Tuple or Set),
196+ each with pair of int/float numbers in every combination
197+ - sequence(List, Tuple or Set) with pairs
198+ of int/float numbers in every combination
199+
200+ ### Parameters:
201+ - `value`: any valid structure with int/float numbers in every combination.
202+ """
203+
204+ class PyLine :
205+ """Represent line field in PostgreSQL and LineSegment in Rust."""
206+
207+ def __init__ (self : Self , value : PairsOfCoordinates ) -> None :
208+ """Create new instance of PyLine.
209+
210+ You need to pass any of this structures:
211+ - sequence of three int/float numbers(a, b, c)
212+
213+ ### Parameters:
214+ - `value`: any valid structure with int/float numbers.
215+ """
216+
217+ class PyLineSegment :
218+ """Represent lseg field in PostgreSQL and LineSegment in Rust."""
219+
220+ def __init__ (self : Self , value : PairsOfCoordinates ) -> None :
221+ """Create new instance of PyLineSegment.
222+
223+ You need to pass any of this structures:
224+ - sequence(List, Tuple or Set) of two sequences(List, Tuple or Set),
225+ each with pair of int/float numbers in every combination
226+ - sequence(List, Tuple or Set) with two pairs
227+ of int/float numbers in every combination
228+
229+ ### Parameters:
230+ - `value`: any valid structure with int/float numbers in every combination.
231+ """
232+
233+ class PyCircle :
234+ """Represent circle field in PostgreSQL and Circle in Rust."""
235+
236+ def __init__ (
237+ self : Self ,
238+ value : typing .Union [
239+ list [int | float ],
240+ set [int | float ],
241+ tuple [int | float , int | float , int | float ],
242+ ],
243+ ) -> None :
244+ """Create new instance of PyCircle.
245+
246+ You need to pass any of this structures:
247+ - sequence of three int/float numbers(x, y, r)
248+
249+ ### Parameters:
250+ - `value`: any valid structure with int/float numbers.
251+ """
0 commit comments