6868
6969function PyGetSetDef (name:: AbstractString , get:: Function ,set:: Function , doc:: AbstractString = " " )
7070 PyGetSetDef (gstring_ptr (name, name),
71- cfunction (get, PyPtr, ( PyPtr,Ptr{Void}) ),
72- cfunction (set, Int, ( PyPtr,PyPtr,Ptr{Void}) ),
71+ cfunction (get, PyPtr, Tuple{ PyPtr,Ptr{Void}} ),
72+ cfunction (set, Int, Tuple{ PyPtr,PyPtr,Ptr{Void}} ),
7373 isempty (doc) ? NULL_UInt8_Ptr : gstring_ptr (name, doc),
7474 C_NULL )
7575end
7676
7777function PyGetSetDef (name:: AbstractString , get:: Function , doc:: AbstractString = " " )
7878 PyGetSetDef (gstring_ptr (name, name),
79- cfunction (get, PyPtr, ( PyPtr,Ptr{Void}) ),
79+ cfunction (get, PyPtr, Tuple{ PyPtr,Ptr{Void}} ),
8080 C_NULL ,
8181 isempty (doc) ? NULL_UInt8_Ptr : gstring_ptr (name, doc),
8282 C_NULL )
@@ -319,8 +319,9 @@ function PyTypeObject!(init::Function, t::PyTypeObject, name::AbstractString, ba
319319 if t. tp_new == C_NULL
320320 t. tp_new = @pyglobal :PyType_GenericNew
321321 end
322- @pycheckz ccall ((@pysym :PyType_Ready ), Cint, (Ptr{PyTypeObject},), & t)
323- ccall ((@pysym :Py_IncRef ), Void, (Ptr{PyTypeObject},), & t)
322+ # TODO change to `Ref{PyTypeObject}` when 0.6 is dropped.
323+ @pycheckz ccall ((@pysym :PyType_Ready ), Cint, (Any,), t)
324+ ccall ((@pysym :Py_IncRef ), Void, (Any,), t)
324325 return t
325326end
326327
@@ -422,13 +423,13 @@ function pyjlwrap_init()
422423 PyMemberDef (C_NULL ,0 ,0 ,0 ,C_NULL ))
423424
424425 # all cfunctions must be compiled at runtime
425- pyjlwrap_dealloc_ptr = cfunction (pyjlwrap_dealloc, Void, ( PyPtr,) )
426- pyjlwrap_repr_ptr = cfunction (pyjlwrap_repr, PyPtr, ( PyPtr,) )
427- pyjlwrap_hash_ptr = cfunction (pyjlwrap_hash, UInt, ( PyPtr,) )
428- pyjlwrap_hash32_ptr = cfunction (pyjlwrap_hash32, UInt32, ( PyPtr,) )
429- pyjlwrap_call_ptr = cfunction (pyjlwrap_call, PyPtr, ( PyPtr,PyPtr,PyPtr) )
430- pyjlwrap_getattr_ptr = cfunction (pyjlwrap_getattr, PyPtr, ( PyPtr,PyPtr) )
431- pyjlwrap_getiter_ptr = cfunction (pyjlwrap_getiter, PyPtr, ( PyPtr,) )
426+ pyjlwrap_dealloc_ptr = cfunction (pyjlwrap_dealloc, Void, Tuple{ PyPtr} )
427+ pyjlwrap_repr_ptr = cfunction (pyjlwrap_repr, PyPtr, Tuple{ PyPtr} )
428+ pyjlwrap_hash_ptr = cfunction (pyjlwrap_hash, UInt, Tuple{ PyPtr} )
429+ pyjlwrap_hash32_ptr = cfunction (pyjlwrap_hash32, UInt32, Tuple{ PyPtr} )
430+ pyjlwrap_call_ptr = cfunction (pyjlwrap_call, PyPtr, Tuple{ PyPtr,PyPtr,PyPtr} )
431+ pyjlwrap_getattr_ptr = cfunction (pyjlwrap_getattr, PyPtr, Tuple{ PyPtr,PyPtr} )
432+ pyjlwrap_getiter_ptr = cfunction (pyjlwrap_getiter, PyPtr, Tuple{ PyPtr} )
432433
433434 # detect at runtime whether we are using Stackless Python
434435 try
453454function pyjlwrap_type! (init:: Function , to:: PyTypeObject , name:: AbstractString )
454455 sz = sizeof (Py_jlWrap) + sizeof (PyPtr) # must be > base type
455456 PyTypeObject! (to, name, sz) do t:: PyTypeObject
456- t. tp_base = ccall (:jl_value_ptr , Ptr{Void}, (Ptr{PyTypeObject},), & jlWrapType)
457- ccall ((@pysym :Py_IncRef ), Void, (Ptr{PyTypeObject},), & jlWrapType)
457+ # TODO change to `Ref{PyTypeObject}` when 0.6 is dropped.
458+ t. tp_base = ccall (:jl_value_ptr , Ptr{Void}, (Any,), jlWrapType)
459+ ccall ((@pysym :Py_IncRef ), Void, (Any,), jlWrapType)
458460 init (t)
459461 end
460462end
@@ -467,8 +469,9 @@ pyjlwrap_type(init::Function, name::AbstractString) =
467469# since, the jl_value_t* may be to a temporary copy. But don't need
468470# to wrap isbits types in Python objects anyway.)
469471function pyjlwrap_new (pyT:: PyTypeObject , value:: Any )
472+ # TODO change to `Ref{PyTypeObject}` when 0.6 is dropped.
470473 o = PyObject (@pycheckn ccall ((@pysym :_PyObject_New ),
471- PyPtr, (Ptr{PyTypeObject} ,), & pyT))
474+ PyPtr, (Any ,), pyT))
472475 pycall_gc[o. o] = value
473476 p = convert (Ptr{Ptr{Void}}, o. o)
474477 unsafe_store! (p, ccall (:jl_value_ptr , Ptr{Void}, (Any,), value), 3 )
@@ -479,7 +482,8 @@ function pyjlwrap_new(x::Any)
479482 pyjlwrap_new (jlWrapType, x)
480483end
481484
482- is_pyjlwrap (o:: PyObject ) = jlWrapType. tp_new != C_NULL && ccall ((@pysym :PyObject_IsInstance ), Cint, (PyPtr,Ptr{PyTypeObject}), o, & jlWrapType) == 1
485+ # TODO change to `Ref{PyTypeObject}` when 0.6 is dropped.
486+ is_pyjlwrap (o:: PyObject ) = jlWrapType. tp_new != C_NULL && ccall ((@pysym :PyObject_IsInstance ), Cint, (PyPtr, Any), o, jlWrapType) == 1
483487
484488# ###############################################################
485489# Fallback conversion: if we don't have a better conversion function,
0 commit comments