@@ -5,12 +5,12 @@ types stub for ctypes functions
55# Copyright (C) 2020 The Psycopg Team
66
77from typing import Any , Callable , Optional , Sequence
8- from ctypes import Array , pointer
8+ from ctypes import Array , pointer , _Pointer
99from ctypes import c_char , c_char_p , c_int , c_ubyte , c_uint , c_ulong
1010
1111class FILE : ...
1212
13- def fdopen (fd : int , mode : bytes ) -> pointer [FILE ]: ... # type: ignore[type-var]
13+ def fdopen (fd : int , mode : bytes ) -> _Pointer [FILE ]: ... # type: ignore[type-var]
1414
1515Oid = c_uint
1616
@@ -62,14 +62,14 @@ def PQprepare(
6262) -> PGresult_struct : ...
6363def PQgetvalue (
6464 arg1 : Optional [PGresult_struct ], arg2 : int , arg3 : int
65- ) -> pointer [c_char ]: ...
65+ ) -> _Pointer [c_char ]: ...
6666def PQcmdTuples (arg1 : Optional [PGresult_struct ]) -> bytes : ...
6767def PQescapeStringConn (
6868 arg1 : Optional [PGconn_struct ],
6969 arg2 : c_char_p ,
7070 arg3 : bytes ,
7171 arg4 : int ,
72- arg5 : pointer [c_int ],
72+ arg5 : _Pointer [c_int ],
7373) -> int : ...
7474def PQescapeString (arg1 : c_char_p , arg2 : bytes , arg3 : int ) -> int : ...
7575def PQsendPrepare (
@@ -98,10 +98,10 @@ def PQsetNoticeReceiver(
9898# a subtype of "ctypes._CData"
9999def PQnotifies (
100100 arg1 : Optional [PGconn_struct ],
101- ) -> Optional [pointer [PGnotify_struct ]]: ... # type: ignore
101+ ) -> Optional [_Pointer [PGnotify_struct ]]: ... # type: ignore
102102def PQputCopyEnd (arg1 : Optional [PGconn_struct ], arg2 : Optional [bytes ]) -> int : ...
103103
104- # Arg 2 is a pointer , reported as _CArgObject by mypy
104+ # Arg 2 is a _Pointer , reported as _CArgObject by mypy
105105def PQgetCopyData (arg1 : Optional [PGconn_struct ], arg2 : Any , arg3 : int ) -> int : ...
106106def PQsetResultAttrs (
107107 arg1 : Optional [PGresult_struct ],
@@ -110,7 +110,7 @@ def PQsetResultAttrs(
110110) -> int : ...
111111def PQtrace (
112112 arg1 : Optional [PGconn_struct ],
113- arg2 : pointer [FILE ], # type: ignore[type-var]
113+ arg2 : _Pointer [FILE ], # type: ignore[type-var]
114114) -> None : ...
115115def PQencryptPasswordConn (
116116 arg1 : Optional [PGconn_struct ],
@@ -133,7 +133,7 @@ def PQconnectPoll(arg1: Optional[PGconn_struct]) -> int: ...
133133def PQconndefaults () -> Sequence [PQconninfoOption_struct ]: ...
134134def PQconninfoFree (arg1 : Sequence [PQconninfoOption_struct ]) -> None : ...
135135def PQconninfo (arg1 : Optional [PGconn_struct ]) -> Sequence [PQconninfoOption_struct ]: ...
136- def PQconninfoParse (arg1 : bytes , arg2 : pointer [c_char_p ]) -> Sequence [PQconninfoOption_struct ]: ...
136+ def PQconninfoParse (arg1 : bytes , arg2 : _Pointer [c_char_p ]) -> Sequence [PQconninfoOption_struct ]: ...
137137def PQfinish (arg1 : Optional [PGconn_struct ]) -> None : ...
138138def PQreset (arg1 : Optional [PGconn_struct ]) -> None : ...
139139def PQresetStart (arg1 : Optional [PGconn_struct ]) -> int : ...
@@ -158,7 +158,7 @@ def PQconnectionNeedsPassword(arg1: Optional[PGconn_struct]) -> int: ...
158158def PQconnectionUsedPassword (arg1 : Optional [PGconn_struct ]) -> int : ...
159159def PQsslInUse (arg1 : Optional [PGconn_struct ]) -> int : ...
160160def PQexec (arg1 : Optional [PGconn_struct ], arg2 : bytes ) -> PGresult_struct : ...
161- def PQexecParams (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int , arg4 : pointer [c_uint ], arg5 : pointer [c_char_p ], arg6 : pointer [c_int ], arg7 : pointer [c_int ], arg8 : int ) -> PGresult_struct : ...
161+ def PQexecParams (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int , arg4 : _Pointer [c_uint ], arg5 : _Pointer [c_char_p ], arg6 : _Pointer [c_int ], arg7 : _Pointer [c_int ], arg8 : int ) -> PGresult_struct : ...
162162def PQdescribePrepared (arg1 : Optional [PGconn_struct ], arg2 : bytes ) -> PGresult_struct : ...
163163def PQdescribePortal (arg1 : Optional [PGconn_struct ], arg2 : bytes ) -> PGresult_struct : ...
164164def PQresultStatus (arg1 : Optional [PGresult_struct ]) -> int : ...
@@ -182,11 +182,11 @@ def PQcmdStatus(arg1: Optional[PGresult_struct]) -> Optional[bytes]: ...
182182def PQoidValue (arg1 : Optional [PGresult_struct ]) -> int : ...
183183def PQescapeLiteral (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int ) -> Optional [bytes ]: ...
184184def PQescapeIdentifier (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int ) -> Optional [bytes ]: ...
185- def PQescapeByteaConn (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int , arg4 : pointer [c_ulong ]) -> pointer [c_ubyte ]: ...
186- def PQescapeBytea (arg1 : bytes , arg2 : int , arg3 : pointer [c_ulong ]) -> pointer [c_ubyte ]: ...
187- def PQunescapeBytea (arg1 : bytes , arg2 : pointer [c_ulong ]) -> pointer [c_ubyte ]: ...
185+ def PQescapeByteaConn (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int , arg4 : _Pointer [c_ulong ]) -> _Pointer [c_ubyte ]: ...
186+ def PQescapeBytea (arg1 : bytes , arg2 : int , arg3 : _Pointer [c_ulong ]) -> _Pointer [c_ubyte ]: ...
187+ def PQunescapeBytea (arg1 : bytes , arg2 : _Pointer [c_ulong ]) -> _Pointer [c_ubyte ]: ...
188188def PQsendQuery (arg1 : Optional [PGconn_struct ], arg2 : bytes ) -> int : ...
189- def PQsendQueryParams (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int , arg4 : pointer [c_uint ], arg5 : pointer [c_char_p ], arg6 : pointer [c_int ], arg7 : pointer [c_int ], arg8 : int ) -> int : ...
189+ def PQsendQueryParams (arg1 : Optional [PGconn_struct ], arg2 : bytes , arg3 : int , arg4 : _Pointer [c_uint ], arg5 : _Pointer [c_char_p ], arg6 : _Pointer [c_int ], arg7 : _Pointer [c_int ], arg8 : int ) -> int : ...
190190def PQsendDescribePrepared (arg1 : Optional [PGconn_struct ], arg2 : bytes ) -> int : ...
191191def PQsendDescribePortal (arg1 : Optional [PGconn_struct ], arg2 : bytes ) -> int : ...
192192def PQgetResult (arg1 : Optional [PGconn_struct ]) -> PGresult_struct : ...
0 commit comments