Repository: JuliaPy/PyCall.jl
Pull request #1014 (2022-11-22 04:31:48)

fix BoundsError of args[1] when args is empty
if `args` on L101 is empty, then `args[1]` in `isexpr()` would throw `BoundsError: attempt to access 0-element Vector{Any} at index [1]`

```julia
julia> ex = :(f()::Float64)
:(f()::Float64)

julia> args = ex.args[1].args[2:end]
Any[]

julia> args[1]
ERROR: BoundsError: attempt to access 0-element Vector{Any} at index [1]
Stacktrace:
 [1] getindex(A::Vector{Any}, i1::Int64)
   @ Base ./array.jl:924
 [2] top-level scope
   @ REPL[118]:1

```

codecov-commenter: # [Codecov](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
Base: **68.35**% // Head: **66.83**% // Decreases project coverage by **`-1.52%`** :warning:
> Coverage data is based on head [(`00d3582`)](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) compared to base [(`9f22684`)](https://codecov.io/gh/JuliaPy/PyCall.jl/commit/9f22684ab26231b1fba66d998e1fc25887f67ed5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).
> Patch coverage: 100.00% of modified lines in pull request are covered.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #1014      +/-   ##
==========================================
- Coverage   68.35%   66.83%   -1.53%     
==========================================
  Files          20       20              
  Lines        2038     2026      -12     
==========================================
- Hits         1393     1354      -39     
- Misses        645      672      +27     
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `66.83% <100.00%> (-1.53%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [src/pyfncall.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3B5Zm5jYWxsLmps) | `97.43% <100.00%> (+0.06%)` | :arrow_up: |
| [src/PyCall.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL1B5Q2FsbC5qbA==) | `65.68% <0.00%> (-6.51%)` | :arrow_down: |
| [src/pyinit.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3B5aW5pdC5qbA==) | `78.00% <0.00%> (-5.00%)` | :arrow_down: |
| [src/startup.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3N0YXJ0dXAuamw=) | `48.14% <0.00%> (-4.98%)` | :arrow_down: |
| [src/exception.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2V4Y2VwdGlvbi5qbA==) | `58.82% <0.00%> (-1.93%)` | :arrow_down: |
| [src/pytype.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3B5dHlwZS5qbA==) | `80.68% <0.00%> (-1.14%)` | :arrow_down: |
| [src/numpy.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL251bXB5Lmps) | `74.68% <0.00%> (-0.63%)` | :arrow_down: |
| [src/io.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2lvLmps) | `83.09% <0.00%> (-0.24%)` | :arrow_down: |
| [src/conversions.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2NvbnZlcnNpb25zLmps) | `63.48% <0.00%> (-0.09%)` | :arrow_down: |
| [src/pyclass.jl](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3B5Y2xhc3Muamw=) | `96.77% <0.00%> (+0.05%)` | :arrow_up: |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/JuliaPy/PyCall.jl/pull/1014?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).


Patch:
diff --git a/.github/workflows/system.yml b/.github/workflows/system.yml
index f61f59f..fefb6b4 100644
--- a/.github/workflows/system.yml
+++ b/.github/workflows/system.yml
@@ -20,7 +20,6 @@ jobs:
         architecture: [x64]
         python-version: ['3.x']
         julia-version:
-          - '1.0'
           - '1'
           - 'nightly'
         include:
@@ -85,6 +84,12 @@ jobs:
           PYTHON: python
       - run: julia test/check_deps_version.jl ${{ matrix.python-version }}
       - uses: julia-actions/julia-runtest@v1
+        env:
+          # Windows temp directories break the CI:
+          #  https://github.com/actions/runner-images/issues/712
+          #  so, we use
+          #  https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
+          _TMP_DIR: ${{ runner.temp }}
       - uses: julia-actions/julia-processcoverage@v1
       - uses: codecov/codecov-action@v1
         with:
diff --git a/Project.toml b/Project.toml
index 74aca7a..b2f641f 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "PyCall"
 uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
 authors = ["Steven G. Johnson <stevenj@mit.edu>", "Yichao Yu <yyc1992@gmail.com>", "Takafumi Arakaki <aka.tkf@gmail.com>", "Simon Kornblith <simon@simonster.com>", "Páll Haraldsson <Pall.Haraldsson@gmail.com>", "Jon Malmaud <malmaud@gmail.com>", "Jake Bolewski <jakebolewski@gmail.com>", "Keno Fischer <keno@alumni.harvard.edu>", "Joel Mason <jobba1@hotmail.com>", "Jameson Nash <vtjnash@gmail.com>", "The JuliaPy development team"]
-version = "1.94.1"
+version = "1.95.0"
 
 [deps]
 Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
@@ -16,7 +16,7 @@ VersionParsing = "81def892-9a0e-5fdd-b105-ffc91e053289"
 Conda = "1.0"
 MacroTools = "0.4, 0.5"
 VersionParsing = "1.0"
-julia = "0.7, 1.0"
+julia = "1.4"
 
 [extras]
 Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
diff --git a/src/PyCall.jl b/src/PyCall.jl
index 7f0317e..0c155fe 100644
--- a/src/PyCall.jl
+++ b/src/PyCall.jl
@@ -299,7 +299,7 @@ function _getproperty(o::PyObject, s::Union{AbstractString,Symbol})
     ispynull(o) && throw(ArgumentError("ref of NULL PyObject"))
     p = ccall((@pysym :PyObject_GetAttrString), PyPtr, (PyPtr, Cstring), o, s)
     if p == C_NULL && pyerr_occurred()
-        e = pyerror("PyObject_GetAttrString")
+        e = PyError("PyObject_GetAttrString")
         if PyPtr(e.T) != @pyglobalobjptr(:PyExc_AttributeError)
             throw(e)
         end
@@ -336,7 +336,7 @@ function _setproperty!(o::PyObject, s::Union{Symbol,AbstractString}, v)
     ispynull(o) && throw(ArgumentError("assign of NULL PyObject"))
     p = ccall((@pysym :PyObject_SetAttrString), Cint, (PyPtr, Cstring, PyPtr), o, s, PyObject(v))
     if p == -1 && pyerr_occurred()
-        e = pyerror("PyObject_SetAttrString")
+        e = PyError("PyObject_SetAttrString")
         if PyPtr(e.T) != @pyglobalobjptr(:PyExc_AttributeError)
             throw(e)
         end
@@ -507,7 +507,7 @@ function pyimport(name::AbstractString)
     o = _pyimport(name)
     if ispynull(o)
         if pyerr_occurred()
-            e = pyerror("PyImport_ImportModule")
+            e = PyError("PyImport_ImportModule")
             if pyisinstance(e.val, @pyglobalobjptr(:PyExc_ImportError))
                 # Expand message to help with common user confusions.
                 msg = """
@@ -553,7 +553,7 @@ or alternatively you can use the Conda package directly (via
 `using Conda` followed by `Conda.add` etcetera).
 """
                 end
-                e = pyerror(string(e.msg, "\n\n", msg, "\n"), e)
+                e = PyError(string(e.msg, "\n\n", msg, "\n"), e)
             end
             throw(e)
         else
@@ -980,16 +980,8 @@ include("serialize.jl")
 include("pyinit.jl")
 
 #########################################################################
-# Precompilation: just an optimization to speed up initialization.
-# Here, we precompile functions that are passed to cfunction by __init__,
-# for the reasons described in JuliaLang/julia#12256.
 
-precompile(pyjlwrap_call, (PyPtr,PyPtr,PyPtr))
-precompile(pyjlwrap_dealloc, (PyPtr,))
-precompile(pyjlwrap_repr, (PyPtr,))
-precompile(pyjlwrap_hash, (PyPtr,))
-precompile(pyjlwrap_hash32, (PyPtr,))
-
-# TODO: precompilation of the io.jl functions
+include("precompile.jl")
 
+#########################################################################
 end # module PyCall
diff --git a/src/exception.jl b/src/exception.jl
index 362719e..a874694 100644
--- a/src/exception.jl
+++ b/src/exception.jl
@@ -49,6 +49,19 @@ function show(io::IO, e::PyError)
     end
 end
 
+# like pyerror(msg) but type-stable: always returns PyError
+function PyError(msg::AbstractString)
+    ptype, pvalue, ptraceback = Ref{PyPtr}(), Ref{PyPtr}(), Ref{PyPtr}()
+    # equivalent of passing C pointers &exc[1], &exc[2], &exc[3]:
+    ccall((@pysym :PyErr_Fetch), Cvoid, (Ref{PyPtr},Ref{PyPtr},Ref{PyPtr}), ptype, pvalue, ptraceback)
+    ccall((@pysym :PyErr_NormalizeException), Cvoid, (Ref{PyPtr},Ref{PyPtr},Ref{PyPtr}), ptype, pvalue, ptraceback)
+    return PyError(msg, PyObject(ptype[]), PyObject(pvalue[]), PyObject(ptraceback[]))
+end
+
+# replace the message from another error
+PyError(msg::AbstractString, e::PyError) =
+    PyError(msg, e.T, e.val, e.traceback)
+
 #########################################################################
 # Conversion of Python exceptions into Julia exceptions
 
@@ -106,17 +119,12 @@ macro pycheckz(ex)
     :(@pycheckv $(esc(ex)) -1)
 end
 
-function pyerror(msg::AbstractString)
-    ptype, pvalue, ptraceback = Ref{PyPtr}(), Ref{PyPtr}(), Ref{PyPtr}()
-    # equivalent of passing C pointers &exc[1], &exc[2], &exc[3]:
-    ccall((@pysym :PyErr_Fetch), Cvoid, (Ref{PyPtr},Ref{PyPtr},Ref{PyPtr}), ptype, pvalue, ptraceback)
-    ccall((@pysym :PyErr_NormalizeException), Cvoid, (Ref{PyPtr},Ref{PyPtr},Ref{PyPtr}), ptype, pvalue, ptraceback)
-    pyerror(msg, PyObject(ptype[]), PyObject(pvalue[]), PyObject(ptraceback[]))
-end
+# like PyError(...) but type-unstable: may unwrap a PyJlError
+# if one was thrown by a nested pyjlwrap function.
 
-function pyerror(msg::AbstractString, e::PyError)
+pyerror(msg::AbstractString) = pyerror(msg, PyError(msg))
+pyerror(msg::AbstractString, e::PyError) =
     pyerror(msg, e.T, e.val, e.traceback)
-end
 
 function pyerror(msg::AbstractString, ptype::PyObject, pvalue::PyObject, ptraceback::PyObject)
     pargs = _getproperty(pvalue, "args")
diff --git a/src/precompile.jl b/src/precompile.jl
new file mode 100644
index 0000000..cdd7590
--- /dev/null
+++ b/src/precompile.jl
@@ -0,0 +1,531 @@
+# Here, we precompile functions that are passed to cfunction by __init__,
+# for the reasons described in JuliaLang/julia#12256.
+
+precompile(pyjlwrap_call, (PyPtr,PyPtr,PyPtr))
+precompile(pyjlwrap_dealloc, (PyPtr,))
+precompile(pyjlwrap_repr, (PyPtr,))
+precompile(pyjlwrap_hash, (PyPtr,))
+precompile(pyjlwrap_hash32, (PyPtr,))
+
+
+# The following calls were generated by running a PySR example
+# (see https://github.com/MilesCranmer/PySR/pull/230),
+# and also test/runtests.jl of PyCall.jl v1.94.1, with `--trace-compile=stderr`,
+# and with `@testset` and `@test` replaced with identity macros.
+# Overly-specific calls were then removed.
+
+# All calls are sorted in the following list.
+precompile(Tuple{FuncWrapper{Tuple{Complex{Int64}}, typeof(sin)}, Complex{Int64}})
+precompile(Tuple{FuncWrapper{Tuple{Int64}, typeof(factorial)}, Int64})
+precompile(Tuple{PyObject, Array{Any, 1}, Vararg{Any}})
+precompile(Tuple{PyObject, Array{Int64, 1}, Vararg{Any}})
+precompile(Tuple{PyObject, Array{String, 1}})
+precompile(Tuple{PyObject, Bool})
+precompile(Tuple{PyObject, Dict{Int64, PyObject}})
+precompile(Tuple{PyObject, Function})
+precompile(Tuple{PyObject, Int64, Vararg{Any}})
+precompile(Tuple{PyObject, Int64, Vararg{Int64}})
+precompile(Tuple{PyObject, Int64})
+precompile(Tuple{PyObject, PyObject, Vararg{Any}})
+precompile(Tuple{PyObject, PyObject, Vararg{PyObject}})
+precompile(Tuple{PyObject, String, Vararg{Any}})
+precompile(Tuple{PyObject, String, Vararg{String}})
+precompile(Tuple{PyObject, UnitRange{Int64}, Vararg{UnitRange{Int64}}})
+precompile(Tuple{PyObject})
+precompile(Tuple{Type{Base.IteratorSize}, PyIterator{PyObject, Base.SizeUnknown}})
+precompile(Tuple{Type{Dict{K, V} where V where K}, Pair{Int64, PyObject}})
+precompile(Tuple{Type{Dict{Module, PyDict{String, PyObject, true}}}})
+precompile(Tuple{Type{Dict{Ptr{PyObject_struct}, Any}}})
+precompile(Tuple{Type{Docs.Binding}, PyObject, Symbol})
+precompile(Tuple{Type{FuncWrapper{Tuple{Complex{Int64}}, typeof(sin)}}, Function, Dict{Symbol, Any}})
+precompile(Tuple{Type{FuncWrapper{Tuple{Int64}, typeof(factorial)}}, Function, Dict{Symbol, Any}})
+precompile(Tuple{Type{IdDict{DataType, Ptr{PyObject_struct}}}})
+precompile(Tuple{Type{Iterators.Zip{Is} where Is<:Tuple}, Tuple{PyIterator{Int64, Base.SizeUnknown}, UnitRange{Int64}}})
+precompile(Tuple{Type{Iterators.Zip{Is} where Is<:Tuple}, Tuple{PyIterator{PyObject, Base.HasLength}, UnitRange{Int64}}})
+precompile(Tuple{Type{Iterators.Zip{Is} where Is<:Tuple}, Tuple{PyObject, UnitRange{Int64}}})
+precompile(Tuple{Type{NamedTuple{(:dtype,), T} where T<:Tuple}, Tuple{PyObject}})
+precompile(Tuple{Type{Pair{A, B} where B where A}, Int64, PyObject})
+precompile(Tuple{Type{Pair{A, B} where B where A}, Symbol, PyObject})
+precompile(Tuple{Type{Ptr{PyObject_struct}}, Ptr{Nothing}})
+precompile(Tuple{Type{Ptr{PyObject_struct}}, Ptr{PyObject_struct}})
+precompile(Tuple{Type{Ptr{PyObject_struct}}, PyObject})
+precompile(Tuple{Type{PyAny}, PyObject})
+precompile(Tuple{Type{PyArray{Bool, 1}}, PyObject, PyArray_Info{Bool, 1}})
+precompile(Tuple{Type{PyArray{Bool, 3}}, PyObject, PyArray_Info{Bool, 3}})
+precompile(Tuple{Type{PyArray{Complex{Float64}, 2}}, PyObject, PyArray_Info{Complex{Float64}, 2}})
+precompile(Tuple{Type{PyArray{Float16, 1}}, PyObject, PyArray_Info{Float16, 1}})
+precompile(Tuple{Type{PyArray{Float16, 2}}, PyObject, PyArray_Info{Float16, 2}})
+precompile(Tuple{Type{PyArray{Float32, 1}}, PyObject, PyArray_Info{Float32, 1}})
+precompile(Tuple{Type{PyArray{Float32, 2}}, PyObject, PyArray_Info{Float32, 2}})
+precompile(Tuple{Type{PyArray{Float64, 1}}, PyObject, PyArray_Info{Float64, 1}})
+precompile(Tuple{Type{PyArray{Float64, 2}}, PyObject, PyArray_Info{Float64, 2}})
+precompile(Tuple{Type{PyArray{Float64, 3}}, PyObject, PyArray_Info{Float64, 3}})
+precompile(Tuple{Type{PyArray{Int16, 1}}, PyObject, PyArray_Info{Int16, 1}})
+precompile(Tuple{Type{PyArray{Int32, 1}}, PyObject, PyArray_Info{Int32, 1}})
+precompile(Tuple{Type{PyArray{Int32, 2}}, PyObject, PyArray_Info{Int32, 2}})
+precompile(Tuple{Type{PyArray{Int64, 0}}, PyObject, PyArray_Info{Int64, 0}})
+precompile(Tuple{Type{PyArray{Int64, 1}}, PyObject, PyArray_Info{Int64, 1}})
+precompile(Tuple{Type{PyArray{Int64, 2}}, PyObject, PyArray_Info{Int64, 2}})
+precompile(Tuple{Type{PyArray{Int64, 3}}, PyObject, PyArray_Info{Int64, 3}})
+precompile(Tuple{Type{PyArray{Int8, 1}}, PyObject, PyArray_Info{Int64, 1}})
+precompile(Tuple{Type{PyArray{Ptr{Nothing}, 0}}, PyObject, PyArray_Info{Ptr{Nothing}, 0}})
+precompile(Tuple{Type{PyArray{Ptr{PyObject_struct}, 1}}, PyObject, PyArray_Info{Ptr{PyObject_struct}, 1}})
+precompile(Tuple{Type{PyArray{Ptr{PyObject_struct}, 2}}, PyObject, PyArray_Info{Ptr{PyObject_struct}, 2}})
+precompile(Tuple{Type{PyArray{T, N} where N where T}, PyObject})
+precompile(Tuple{Type{PyBuffer}, PyObject})
+precompile(Tuple{Type{PyDict{Int64, Int64, true}}, PyObject})
+precompile(Tuple{Type{PyDict{Int64, PyObject, false}}, PyObject})
+precompile(Tuple{Type{PyDict{Int64, String, true}}, PyObject})
+precompile(Tuple{Type{PyDict{K, V, isdict} where isdict where V where K}, Dict{Int64, Int64}})
+precompile(Tuple{Type{PyDict{K, V, isdict} where isdict where V where K}, Dict{Int64, String}})
+precompile(Tuple{Type{PyDict{K, V, isdict} where isdict where V where K}, PyObject})
+precompile(Tuple{Type{PyDict{PyAny, PyAny, true}}, PyObject})
+precompile(Tuple{Type{PyDict{Symbol, PyObject, true}}, PyObject})
+precompile(Tuple{Type{PyIterator{Float64, Base.HasLength}}, PyObject})
+precompile(Tuple{Type{PyIterator{Float64, S} where S}, PyObject})
+precompile(Tuple{Type{PyIterator{Int64, Base.SizeUnknown}}, PyObject})
+precompile(Tuple{Type{PyIterator{Int64, S} where S}, PyObject})
+precompile(Tuple{Type{PyIterator{PyAny, Base.HasLength}}, PyObject})
+precompile(Tuple{Type{PyIterator{PyAny, S} where S}, PyObject})
+precompile(Tuple{Type{PyIterator{PyObject, Base.HasLength}}, PyObject})
+precompile(Tuple{Type{PyIterator{PyObject, Base.SizeUnknown}}, PyObject})
+precompile(Tuple{Type{PyIterator{T, S} where S where T}, PyObject})
+precompile(Tuple{Type{PyMemberDef}, Ptr{Nothing}, Int64, Int64, Int64, Ptr{Nothing}})
+precompile(Tuple{Type{PyObject}, Array{Any, 0}})
+precompile(Tuple{Type{PyObject}, Array{Any, 1}})
+precompile(Tuple{Type{PyObject}, Array{Complex{Float64}, 1}})
+precompile(Tuple{Type{PyObject}, Array{Float64, 3}})
+precompile(Tuple{Type{PyObject}, Array{PyObject, 1}})
+precompile(Tuple{Type{PyObject}, Array{UInt32, 1}})
+precompile(Tuple{Type{PyObject}, Array{UInt8, 1}})
+precompile(Tuple{Type{PyObject}, Base.Generator{UnitRange{Int64}, typeof(identity)}})
+precompile(Tuple{Type{PyObject}, Bool})
+precompile(Tuple{Type{PyObject}, Complex{Int64}})
+precompile(Tuple{Type{PyObject}, Float64})
+precompile(Tuple{Type{PyObject}, Function})
+precompile(Tuple{Type{PyObject}, Int128})
+precompile(Tuple{Type{PyObject}, Int64})
+precompile(Tuple{Type{PyObject}, Module})
+precompile(Tuple{Type{PyObject}, Ptr{Nothing}})
+precompile(Tuple{Type{PyObject}, PyObject})
+precompile(Tuple{Type{PyObject}, String})
+precompile(Tuple{Type{PyObject}, Tuple{Int64}})
+precompile(Tuple{Type{PyObject}, Type})
+precompile(Tuple{Type{PyObject}, UnitRange{Int64}})
+precompile(Tuple{Type{PyTypeObject}})
+precompile(Tuple{Type{Ref{Ptr{PyObject_struct}}}, Int64})
+precompile(Tuple{Type{Ref{PyMethodDef}}})
+precompile(Tuple{Type{Ref{Union{Nothing, Tuple{PyObject, Int64}}}}, Tuple{PyObject, Int64}})
+precompile(Tuple{typeof(:(!=)), Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(:(!=)), PyObject, Float64})
+precompile(Tuple{typeof(:(&)), Int64, PyObject})
+precompile(Tuple{typeof(:(&)), PyObject, Int64})
+precompile(Tuple{typeof(:(&)), PyObject, PyObject})
+precompile(Tuple{typeof(:(*)), Int64, PyObject})
+precompile(Tuple{typeof(:(*)), PyObject, Int64})
+precompile(Tuple{typeof(:(*)), PyObject, PyObject})
+precompile(Tuple{typeof(:(-)), Int64, PyObject})
+precompile(Tuple{typeof(:(-)), PyObject, Int128})
+precompile(Tuple{typeof(:(-)), PyObject, Int64})
+precompile(Tuple{typeof(:(-)), PyObject, PyObject})
+precompile(Tuple{typeof(:(-)), PyObject})
+precompile(Tuple{typeof(:(/)), Int64, PyObject})
+precompile(Tuple{typeof(:(/)), PyObject, Int64})
+precompile(Tuple{typeof(:(/)), PyObject, PyObject})
+precompile(Tuple{typeof(:(<)), PyObject, Float64})
+precompile(Tuple{typeof(:(<)), PyObject, PyObject})
+precompile(Tuple{typeof(:(<<)), Int64, PyObject})
+precompile(Tuple{typeof(:(<<)), PyObject, Int64})
+precompile(Tuple{typeof(:(<<)), PyObject, PyObject})
+precompile(Tuple{typeof(:(<=)), PyObject, Float64})
+precompile(Tuple{typeof(:(<=)), PyObject, PyObject})
+precompile(Tuple{typeof(:(==)), Array{PyObject, 1}, Array{Int64, 1}})
+precompile(Tuple{typeof(:(==)), Array{PyObject, 2}, Array{Int64, 2}})
+precompile(Tuple{typeof(:(==)), Array{Tuple{PyObject, Int64}, 1}, Array{Tuple{Int64, Int64}, 1}})
+precompile(Tuple{typeof(:(==)), Dict{Int64, Int64}, PyDict{Int64, Int64, true}})
+precompile(Tuple{typeof(:(==)), Dict{Int64, PyObject}, Dict{Int64, PyObject}})
+precompile(Tuple{typeof(:(==)), Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(:(==)), PyArray{Float64, 2}, Array{Float64, 2}})
+precompile(Tuple{typeof(:(==)), PyDict{Int64, Int64, true}, Dict{Int64, Int64}})
+precompile(Tuple{typeof(:(==)), PyDict{PyAny, PyAny, true}, Dict{Int64, String}})
+precompile(Tuple{typeof(:(==)), PyObject, Float64})
+precompile(Tuple{typeof(:(==)), PyObject, Int64})
+precompile(Tuple{typeof(:(==)), Tuple{PyObject, PyObject, PyObject, PyObject, PyObject}, Tuple{PyObject, PyObject, PyObject, PyObject, PyObject}})
+precompile(Tuple{typeof(:(==)), Tuple{PyObject, PyObject, PyObject}, Tuple{PyObject, PyObject, PyObject}})
+precompile(Tuple{typeof(:(==)), Tuple{PyObject, PyObject}, Tuple{PyObject, PyObject}})
+precompile(Tuple{typeof(:(>)), PyObject, Float64})
+precompile(Tuple{typeof(:(>)), PyObject, PyObject})
+precompile(Tuple{typeof(:(>=)), PyObject, Float64})
+precompile(Tuple{typeof(:(>>)), Int64, PyObject})
+precompile(Tuple{typeof(:(>>)), PyObject, Int64})
+precompile(Tuple{typeof(:(>>)), PyObject, PyObject})
+precompile(Tuple{typeof(:(^)), Int64, PyObject})
+precompile(Tuple{typeof(:(^)), PyObject, Int64})
+precompile(Tuple{typeof(:(^)), PyObject, PyObject})
+precompile(Tuple{typeof(:(|)), Int64, PyObject})
+precompile(Tuple{typeof(:(|)), PyObject, Int64})
+precompile(Tuple{typeof(:(|)), PyObject, PyObject})
+precompile(Tuple{typeof(:(~)), PyObject})
+precompile(Tuple{typeof(Base._append!), Array{PyMemberDef, 1}, Base.HasLength, Tuple{PyMemberDef, PyMemberDef}})
+precompile(Tuple{typeof(Base.cconvert), Type, Base.RefValue{PyMethodDef}})
+precompile(Tuple{typeof(Base.cconvert), Type{Ptr{PyObject_struct}}, Ptr{Nothing}})
+precompile(Tuple{typeof(Base.cconvert), Type{Ptr{PyObject_struct}}, PyObject})
+precompile(Tuple{typeof(Base.indexed_iterate), Array{PyObject, 1}, Int64, Int64})
+precompile(Tuple{typeof(Base.indexed_iterate), Array{PyObject, 1}, Int64})
+precompile(Tuple{typeof(Base.indexed_iterate), Pair{Symbol, PyObject}, Int64, Int64})
+precompile(Tuple{typeof(Base.indexed_iterate), Pair{Symbol, PyObject}, Int64})
+precompile(Tuple{typeof(Base.indexed_iterate), Tuple{PyObject, Int64}, Int64, Int64})
+precompile(Tuple{typeof(Base.indexed_iterate), Tuple{PyObject, Int64}, Int64})
+precompile(Tuple{typeof(Base.vect), PyObject, Vararg{PyObject}})
+precompile(Tuple{typeof(Base.vect), PyObject})
+precompile(Tuple{typeof(Broadcast.broadcasted), Function, Array{Float64, 1}, PyArray{Float64, 1}})
+precompile(Tuple{typeof(Broadcast.broadcasted), Function, PyArray{Ptr{PyObject_struct}, 1}})
+precompile(Tuple{typeof(Broadcast.broadcasted), Function, PyArray{Ptr{PyObject_struct}, 2}})
+precompile(Tuple{typeof(Broadcast.broadcasted), Function, PyObject, Array{Int64, 1}})
+precompile(Tuple{typeof(Core.Compiler.eltype), Type{Array{PyObject, 1}}})
+precompile(Tuple{typeof(Core.convert), Type{DataType}, Type{Ptr{PyObject_struct}}})
+precompile(Tuple{typeof(Docs.doc), PyObject})
+precompile(Tuple{typeof(Iterators.zip), PyIterator{Int64, Base.SizeUnknown}, Vararg{Any}})
+precompile(Tuple{typeof(Iterators.zip), PyIterator{PyObject, Base.HasLength}, Vararg{Any}})
+precompile(Tuple{typeof(Iterators.zip), PyObject, Vararg{Any}})
+precompile(Tuple{typeof(NoCopyArray), PyObject})
+precompile(Tuple{typeof(PyNULL)})
+precompile(Tuple{typeof(PyReverseDims), Array{Int64, 3}})
+precompile(Tuple{typeof(PyReverseDims), BitArray{3}})
+precompile(Tuple{typeof(Py_Finalize)})
+precompile(Tuple{typeof(Py_GetVersion), Ptr{Nothing}})
+precompile(Tuple{typeof(Py_SetPythonHome), Ptr{Nothing}, VersionNumber, String})
+precompile(Tuple{typeof(__init__)})
+precompile(Tuple{typeof(_insert!), PyObject, Int64, Int64})
+precompile(Tuple{typeof(_pyjlwrap_call), Function, Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(_pyjlwrap_call), Type, Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(_pywith), Expr, Nothing, Type, Expr})
+precompile(Tuple{typeof(_pywith), Expr, Symbol, Type, Expr})
+precompile(Tuple{typeof(_set_finalized)})
+precompile(Tuple{typeof(abs), PyObject})
+precompile(Tuple{typeof(append!), PyObject, Array{Int64, 1}})
+precompile(Tuple{typeof(append!), PyObject, PyObject})
+precompile(Tuple{typeof(callsym), Expr})
+precompile(Tuple{typeof(collect), Base.KeySet{Int64, PyDict{Int64, String, true}}})
+precompile(Tuple{typeof(collect), Iterators.Zip{Tuple{PyIterator{Int64, Base.SizeUnknown}, UnitRange{Int64}}}})
+precompile(Tuple{typeof(collect), Iterators.Zip{Tuple{PyIterator{PyObject, Base.HasLength}, UnitRange{Int64}}}})
+precompile(Tuple{typeof(collect), Iterators.Zip{Tuple{PyObject, UnitRange{Int64}}}})
+precompile(Tuple{typeof(collect), PyIterator{Float64, Base.HasLength}})
+precompile(Tuple{typeof(collect), PyIterator{PyAny, Base.HasLength}})
+precompile(Tuple{typeof(collect), PyIterator{PyObject, Base.HasLength}})
+precompile(Tuple{typeof(collect), PyObject})
+precompile(Tuple{typeof(convert), Type{AbstractRange{T} where T}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Bool, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Complex{Float64}, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float16, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float32, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float32, 2}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float32, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float64, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float64, 2}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Float64, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Function, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Int32, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Int64, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Int64, 2}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Int64, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{Int8, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{PyAny, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{PyObject, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{PyObject, 2}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{PyObject, N} where N}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{T, N} where N where T}, PyObject})
+precompile(Tuple{typeof(convert), Type{Array{UInt8, 1}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Bool}, PyObject})
+precompile(Tuple{typeof(convert), Type{Complex{Float64}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Complex{Int64}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dates.DateTime}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dates.Date}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dates.Day}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dates.Millisecond}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dates.Second}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dict{Int64, PyObject}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Dict{PyAny, PyAny}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Float32}, PyObject})
+precompile(Tuple{typeof(convert), Type{Float64}, PyObject})
+precompile(Tuple{typeof(convert), Type{Function}, PyObject})
+precompile(Tuple{typeof(convert), Type{Int32}, PyObject})
+precompile(Tuple{typeof(convert), Type{Int64}, PyObject})
+precompile(Tuple{typeof(convert), Type{Int8}, PyObject})
+precompile(Tuple{typeof(convert), Type{Integer}, PyObject})
+precompile(Tuple{typeof(convert), Type{Nothing}, PyObject})
+precompile(Tuple{typeof(convert), Type{Pair{Int64, Int64}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Ptr{Nothing}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Ptr{PyGetSetDef}}, Ptr{Nothing}})
+precompile(Tuple{typeof(convert), Type{Ptr{PyMemberDef}}, Ptr{Nothing}})
+precompile(Tuple{typeof(convert), Type{Ptr{PyMethodDef}}, Ptr{Nothing}})
+precompile(Tuple{typeof(convert), Type{Ptr{PyObject_struct}}, Ptr{Nothing}})
+precompile(Tuple{typeof(convert), Type{Ptr{PyObject_struct}}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(convert), Type{PyArray{T, N} where N where T}, PyObject})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Any, 1}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Float32, 1}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Float32, 2}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Float64, 1}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Float64, 2}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Function, 1}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Int64, 1}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Array{Int64, 2}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Bool})
+precompile(Tuple{typeof(convert), Type{PyObject}, Dict{Function, Dict{K, Int64} where K}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Dict{Function, Int64}})
+precompile(Tuple{typeof(convert), Type{PyObject}, Float32})
+precompile(Tuple{typeof(convert), Type{PyObject}, Float64})
+precompile(Tuple{typeof(convert), Type{PyObject}, Function})
+precompile(Tuple{typeof(convert), Type{PyObject}, Int64})
+precompile(Tuple{typeof(convert), Type{PyObject}, Nothing})
+precompile(Tuple{typeof(convert), Type{PyObject}, PyObject})
+precompile(Tuple{typeof(convert), Type{PyObject}, String})
+precompile(Tuple{typeof(convert), Type{PyObject}, Type})
+precompile(Tuple{typeof(convert), Type{Py_buffer}, Py_buffer})
+precompile(Tuple{typeof(convert), Type{Ref{PyMethodDef}}, Base.RefValue{PyMethodDef}})
+precompile(Tuple{typeof(convert), Type{String}, PyObject})
+precompile(Tuple{typeof(convert), Type{Symbol}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{AbstractRange{T} where T, AbstractRange{T} where T, AbstractRange{T} where T}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Array{Float32, N} where N, Array{Float32, N} where N}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Float64, String}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Int64, Int64, Int64}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Int64, Vararg{Int64}}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Integer, Integer}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Integer, PyAny}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Integer, Tuple{Float64, String}, Bool}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Integer}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Nothing, Nothing, Nothing}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, AbstractString}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, Array{T, N} where N where T}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, Array{UInt8, 1}}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, Bool}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, Integer, Integer}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, Integer}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, Nothing, Nothing, Nothing}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, PyAny}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny, String}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{PyAny}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{String, Integer}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{String, String}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{String}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Vararg{Int64}}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{Vararg{PyAny}}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple{}}, PyObject})
+precompile(Tuple{typeof(convert), Type{Tuple}, PyObject})
+precompile(Tuple{typeof(convert), Type{Type}, PyObject})
+precompile(Tuple{typeof(copy!), PyObject, PyObject})
+precompile(Tuple{typeof(copy), PyArray{Float64, 2}})
+precompile(Tuple{typeof(copy), PyDict{Int64, PyObject, false}})
+precompile(Tuple{typeof(copy), PyDict{PyAny, PyAny, true}})
+precompile(Tuple{typeof(current_python)})
+precompile(Tuple{typeof(delete!), PyDict{String, PyObject, true}, Int64})
+precompile(Tuple{typeof(delete!), PyDict{String, PyObject, true}, String})
+precompile(Tuple{typeof(docstring), Function})
+precompile(Tuple{typeof(eltype), PyArray_Info{Float64, 3}})
+precompile(Tuple{typeof(eltype), PyArray_Info{Int16, 1}})
+precompile(Tuple{typeof(eltype), PyArray_Info{Int32, 2}})
+precompile(Tuple{typeof(eltype), PyArray_Info{Ptr{Nothing}, 0}})
+precompile(Tuple{typeof(eltype), PyArray{Int32, 1}})
+precompile(Tuple{typeof(eltype), PyArray{Int32, 2}})
+precompile(Tuple{typeof(eltype), PyArray{Ptr{PyObject_struct}, 1}})
+precompile(Tuple{typeof(eltype), PyArray{Ptr{PyObject_struct}, 2}})
+precompile(Tuple{typeof(eltype), PyDict{Int64, String, true}})
+precompile(Tuple{typeof(empty!), PyObject})
+precompile(Tuple{typeof(empty), Dict{Any, Any}, Type{Symbol}, Type{PyObject}})
+precompile(Tuple{typeof(f_contiguous), Type{Float64}, Tuple{Int64, Int64, Int64}, Tuple{Int64, Int64, Int64}})
+precompile(Tuple{typeof(f_contiguous), Type{Float64}, Tuple{Int64, Int64}, Tuple{Int64, Int64}})
+precompile(Tuple{typeof(f_contiguous), Type{Float64}, Tuple{Int64}, Tuple{Int64}})
+precompile(Tuple{typeof(findsym), Ptr{Nothing}, Symbol, Vararg{Symbol}})
+precompile(Tuple{typeof(float), PyObject})
+precompile(Tuple{typeof(get), PyObject, Int64})
+precompile(Tuple{typeof(get), PyObject, Tuple{Int64, Int64, Int64}})
+precompile(Tuple{typeof(get), PyObject, Tuple{Int64, Int64}})
+precompile(Tuple{typeof(get), PyObject, Type{PyObject}, Int64})
+precompile(Tuple{typeof(get_format_str), PyBuffer})
+precompile(Tuple{typeof(getindex), Base.RefValue{Union{Nothing, Tuple{PyObject, Int64}}}})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 1}, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 1}, UnitRange{Int64}})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 2}, Base.IteratorsMD.CartesianIndex{2}})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 2}, Int64, Int64, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 2}, Int64, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 3}, Base.IteratorsMD.CartesianIndex{4}})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 3}, Base.IteratorsMD.CartesianIndex{5}})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 3}, Int64, Int64, Int64, Vararg{Int64}})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 3}, Int64, Int64, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 3}, Int64, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Float64, 3}, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Int64, 1}, UnitRange{Int64}})
+precompile(Tuple{typeof(getindex), PyArray{Int64, 2}, UnitRange{Int64}, Int64})
+precompile(Tuple{typeof(getindex), PyArray{Int64, 2}, UnitRange{Int64}, UnitRange{Int64}})
+precompile(Tuple{typeof(getindex), PyArray{Ptr{Nothing}, 0}})
+precompile(Tuple{typeof(getindex), PyDict{Int64, String, true}, Int64})
+precompile(Tuple{typeof(getindex), Type{PyAny}})
+precompile(Tuple{typeof(getindex), Type{PyMemberDef}})
+precompile(Tuple{typeof(getindex), Type{Tuple{PyObject, Type}}})
+precompile(Tuple{typeof(getproperty), PyArray_Info{Int32, 1}, Symbol})
+precompile(Tuple{typeof(getproperty), PyArray_Info{Int32, 2}, Symbol})
+precompile(Tuple{typeof(getproperty), PyArray{Float64, 1}, Symbol})
+precompile(Tuple{typeof(getproperty), PyArray{Float64, 2}, Symbol})
+precompile(Tuple{typeof(getproperty), PyArray{Int32, 1}, Symbol})
+precompile(Tuple{typeof(getproperty), PyArray{Int32, 2}, Symbol})
+precompile(Tuple{typeof(getproperty), PyDict{Int64, String, true}, Symbol})
+precompile(Tuple{typeof(getproperty), PyError, Symbol})
+precompile(Tuple{typeof(getproperty), PyObject, String})
+precompile(Tuple{typeof(hash), PyObject})
+precompile(Tuple{typeof(hashsalt), Function})
+precompile(Tuple{typeof(hasproperty), PyObject, String})
+precompile(Tuple{typeof(hasproperty), PyObject, Symbol})
+precompile(Tuple{typeof(hassym), Ptr{Nothing}, Symbol})
+precompile(Tuple{typeof(include), String})
+precompile(Tuple{typeof(interpolate_pycode), String})
+precompile(Tuple{typeof(is_pyjlwrap), PyObject})
+precompile(Tuple{typeof(isbuftype), PyObject})
+precompile(Tuple{typeof(iscontiguous), PyBuffer})
+precompile(Tuple{typeof(isempty), PyObject})
+precompile(Tuple{typeof(isequal), PyObject, PyObject})
+precompile(Tuple{typeof(isless), PyObject, Float64})
+precompile(Tuple{typeof(isless), PyObject, PyObject})
+precompile(Tuple{typeof(ispynull), PyObject})
+precompile(Tuple{typeof(istuplen), Type, Bool, Int64})
+precompile(Tuple{typeof(iterate), Dict{Symbol, PyObject}, Int64})
+precompile(Tuple{typeof(iterate), Dict{Symbol, PyObject}})
+precompile(Tuple{typeof(jlwrap_iterator), Base.Generator{UnitRange{Int64}, typeof(identity)}})
+precompile(Tuple{typeof(jlwrap_iterator), UnitRange{Int64}})
+precompile(Tuple{typeof(keys), PyDict{Int64, String, true}})
+precompile(Tuple{typeof(keys), PyObject})
+precompile(Tuple{typeof(keys), Type{Int64}, PyDict{Int64, String, true}})
+precompile(Tuple{typeof(length), Array{PyObject, 1}})
+precompile(Tuple{typeof(length), PyBuffer})
+precompile(Tuple{typeof(length), PyIterator{PyObject, Base.HasLength}})
+precompile(Tuple{typeof(length), PyObject})
+precompile(Tuple{typeof(make_fname), String})
+precompile(Tuple{typeof(merge), Dict{Symbol, PyObject}, Dict{Any, Any}, Dict{Any, Any}})
+precompile(Tuple{typeof(merge), Dict{Symbol, PyObject}, Dict{Any, Any}, Dict{Symbol, Int64}})
+precompile(Tuple{typeof(merge), Dict{Symbol, PyObject}, Dict{Symbol, PyObject}, Dict{Any, Any}})
+precompile(Tuple{typeof(ndims), PyBuffer})
+precompile(Tuple{typeof(parse_pydef), Expr})
+precompile(Tuple{typeof(parse_pydef_toplevel), Expr})
+precompile(Tuple{typeof(pickle)})
+precompile(Tuple{typeof(pop!), PyObject})
+precompile(Tuple{typeof(popfirst!), PyObject})
+precompile(Tuple{typeof(prepend!), PyObject, Array{Int64, 1}})
+precompile(Tuple{typeof(prepend!), PyObject, PyObject})
+precompile(Tuple{typeof(propertynames), PyObject})
+precompile(Tuple{typeof(push!), PyObject, Int64})
+precompile(Tuple{typeof(pushfirst!), PyObject, Int64})
+precompile(Tuple{typeof(py2array), Type, Array{Any, 1}, PyObject, Int64, Int64})
+precompile(Tuple{typeof(pyany_toany), Type{Tuple{Int64, PyAny}}})
+precompile(Tuple{typeof(pyany_toany), Type{Tuple{Int64, Tuple{PyAny, Int8}}}})
+precompile(Tuple{typeof(pyany_toany), Type{Tuple{PyAny, Int64, Vararg{PyAny}}}})
+precompile(Tuple{typeof(pyany_toany), Type{Tuple{PyAny, Int8}}})
+precompile(Tuple{typeof(pyany_toany), Type})
+precompile(Tuple{typeof(pybuiltin), String})
+precompile(Tuple{typeof(pybytes), Array{UInt8, 1}})
+precompile(Tuple{typeof(pybytes), String})
+precompile(Tuple{typeof(pycall!), PyObject, PyObject, Type{PyAny}, String, Vararg{Any}})
+precompile(Tuple{typeof(pycall!), PyObject, PyObject, Type{PyObject}, String, Vararg{Any}})
+precompile(Tuple{typeof(pycall!), PyObject, PyObject, Type{Tuple}, String, Vararg{Any}})
+precompile(Tuple{typeof(pycall), PyObject, Type{Bool}, PyObject, Vararg{Any}})
+precompile(Tuple{typeof(pycall), PyObject, Type{Int64}, Int64})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyAny}, Int64})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyAny}, PyObject})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyAny}, String, Vararg{Any}})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyArray{T, N} where N where T}, Array{Int64, 1}})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyArray{T, N} where N where T}, Array{Int64, 2}})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyObject}, Int64})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyObject}, PyObject})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyObject}, String, Vararg{Any}})
+precompile(Tuple{typeof(pycall), PyObject, Type{PyObject}, UnitRange{Int64}})
+precompile(Tuple{typeof(pycall), PyObject, Type{Tuple}, String, Vararg{Any}})
+precompile(Tuple{typeof(pydecref), PyBuffer})
+precompile(Tuple{typeof(pydecref), PyObject})
+precompile(Tuple{typeof(pyerr_clear)})
+precompile(Tuple{typeof(pyerror), String, PyError})
+precompile(Tuple{typeof(pyfunction), Function, Type})
+precompile(Tuple{typeof(pyfunctionret), Function, Nothing, Type})
+precompile(Tuple{typeof(pyfunctionret), Function, Type, Type})
+precompile(Tuple{typeof(pyimport), Symbol})
+precompile(Tuple{typeof(pyimport_conda), String, String})
+precompile(Tuple{typeof(pyimport_e), String})
+precompile(Tuple{typeof(pyincref_), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyisinstance), PyObject, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyisinstance), PyObject, PyObject})
+precompile(Tuple{typeof(pyjlwrap_call), Ptr{PyObject_struct}, Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_dealloc), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_getattr), Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_getiter), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_hash), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_hash32), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_iternext), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pyjlwrap_new), Array{Float32, 1}})
+precompile(Tuple{typeof(pyjlwrap_new), Array{Float32, 2}})
+precompile(Tuple{typeof(pyjlwrap_new), Array{Float64, 1}})
+precompile(Tuple{typeof(pyjlwrap_new), Array{Float64, 2}})
+precompile(Tuple{typeof(pyjlwrap_new), Array{Int64, 1}})
+precompile(Tuple{typeof(pyjlwrap_new), Array{Int64, 2}})
+precompile(Tuple{typeof(pyjlwrap_new), FuncWrapper{Tuple{Complex{Int64}}, typeof(sin)}})
+precompile(Tuple{typeof(pyjlwrap_new), FuncWrapper{Tuple{Int64}, typeof(factorial)}})
+precompile(Tuple{typeof(pyjlwrap_new), Function})
+precompile(Tuple{typeof(pyjlwrap_new), Nothing})
+precompile(Tuple{typeof(pyjlwrap_new), PyTypeObject, Tuple{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.RefValue{Union{Nothing, Tuple{Int64, Int64}}}}})
+precompile(Tuple{typeof(pyjlwrap_new), PyTypeObject, Tuple{UnitRange{Int64}, Base.RefValue{Union{Nothing, Tuple{Int64, Int64}}}}})
+precompile(Tuple{typeof(pyjlwrap_new), UnitRange{Int64}})
+precompile(Tuple{typeof(pyjlwrap_repr), Ptr{PyObject_struct}})
+precompile(Tuple{typeof(pynamespace), Module})
+precompile(Tuple{typeof(pyo2ptr), Type})
+precompile(Tuple{typeof(pyocopy), PyArray{Bool, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Bool, 3}})
+precompile(Tuple{typeof(pyocopy), PyArray{Complex{Float64}, 2}})
+precompile(Tuple{typeof(pyocopy), PyArray{Float16, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Float16, 2}})
+precompile(Tuple{typeof(pyocopy), PyArray{Float32, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Float32, 2}})
+precompile(Tuple{typeof(pyocopy), PyArray{Float64, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Float64, 2}})
+precompile(Tuple{typeof(pyocopy), PyArray{Int32, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Int32, 2}})
+precompile(Tuple{typeof(pyocopy), PyArray{Int64, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Int64, 2}})
+precompile(Tuple{typeof(pyocopy), PyArray{Int64, 3}})
+precompile(Tuple{typeof(pyocopy), PyArray{Ptr{PyObject_struct}, 1}})
+precompile(Tuple{typeof(pyocopy), PyArray{Ptr{PyObject_struct}, 2}})
+precompile(Tuple{typeof(pyrepr), PyObject})
+precompile(Tuple{typeof(pyreturn), Bool})
+precompile(Tuple{typeof(pyreturn), Complex{Float64}})
+precompile(Tuple{typeof(pyreturn), Float64})
+precompile(Tuple{typeof(pyreturn), Int64})
+precompile(Tuple{typeof(pyreturn), Module})
+precompile(Tuple{typeof(pyreturn), Nothing})
+precompile(Tuple{typeof(pyreturn), PyObject})
+precompile(Tuple{typeof(pyreturn), Tuple{}})
+precompile(Tuple{typeof(pystr), PyObject})
+precompile(Tuple{typeof(pytype_query), PyObject})
+precompile(Tuple{typeof(pytypeof), PyObject})
+precompile(Tuple{typeof(rem), Int64, PyObject})
+precompile(Tuple{typeof(rem), PyObject, Int64})
+precompile(Tuple{typeof(rem), PyObject, PyObject})
+precompile(Tuple{typeof(set!), PyObject, Int64, Int64})
+precompile(Tuple{typeof(set!), PyObject, Int64, String})
+precompile(Tuple{typeof(set!), PyObject, Tuple{Int64, Int64, Int64}, Int64})
+precompile(Tuple{typeof(set!), PyObject, Tuple{Int64, Int64}, Int64})
+precompile(Tuple{typeof(setdata!), PyArray{Float64, 1}, PyObject})
+precompile(Tuple{typeof(setindex!), Base.RefValue{Union{Nothing, Tuple{PyObject, Int64}}}, Nothing})
+precompile(Tuple{typeof(setindex!), Dict{DataType, String}, String, Type{Ptr{PyObject_struct}}})
+precompile(Tuple{typeof(setindex!), Dict{Symbol, PyObject}, PyObject, Symbol})
+precompile(Tuple{typeof(setproperty!), PyObject, String, Int64})
+precompile(Tuple{typeof(setproperty!), PyObject, Symbol, Int64})
+precompile(Tuple{typeof(size), PyArray{Float64, 2}, Int64})
+precompile(Tuple{typeof(size), PyBuffer, Int64})
+precompile(Tuple{typeof(size), PyBuffer})
+precompile(Tuple{typeof(stride), PyBuffer, Int64})
+precompile(Tuple{typeof(strides), PyBuffer})
+precompile(Tuple{typeof(string), String, PyObject, Vararg{Any}})
+precompile(Tuple{typeof(tuptype), DataType, Bool, Int64})
+precompile(Tuple{typeof(unsafe_convert), Type{Ptr{PyObject_struct}}, Ptr{Nothing}})
+precompile(Tuple{typeof(unsafe_convert), Type{Ptr{PyObject_struct}}, PyObject})
+precompile(Tuple{typeof(unsafe_convert), Type{Ref{Ptr{PyObject_struct}}}, Base.RefValue{Ptr{PyObject_struct}}})
+precompile(Tuple{typeof(unsafe_load), Ptr{Ptr{PyObject_struct}}})
+precompile(Tuple{typeof(weakref_callback), Ptr{PyObject_struct}, Ptr{PyObject_struct}})
+precompile(Tuple{typeof(xor), Int64, PyObject})
+precompile(Tuple{typeof(xor), PyObject, Int64})
+precompile(Tuple{typeof(xor), PyObject, PyObject})
\ No newline at end of file
diff --git a/src/pyfncall.jl b/src/pyfncall.jl
index fc07d8e..11e8128 100644
--- a/src/pyfncall.jl
+++ b/src/pyfncall.jl
@@ -99,7 +99,7 @@ macro pycall(ex)
     end
     func = ex.args[1].args[1]
     args, kwargs = ex.args[1].args[2:end], []
-    if isexpr(args[1],:parameters)
+    if !isempty(args) && isexpr(args[1],:parameters)
         kwargs, args = args[1], args[2:end]
     end
     T = ex.args[2]


Test patch:
diff --git a/test/runtests.jl b/test/runtests.jl
index e16b31a..2e5c915 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -290,7 +290,7 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
     end
     @test convert(BigInt, PyObject(1234)) == 1234
 
-    # hasproperty, getproperty, and propertynames
+    # hasproperty, getproperty, trygetproperty, and propertynames
     py"""
     class A:
         class B:
@@ -302,6 +302,7 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
     A = py"A"
     @test hasproperty(A, "B")
     @test getproperty(A, "B") == py"A.B"
+    @test PyCall.trygetproperty(A, "C", nothing) === py"None"
     @test :B in propertynames(A)
     @static if VERSION >= v"0.7-"
         @test :D in propertynames(A.B)
@@ -529,6 +530,8 @@ const PyInt = pyversion < v"3" ? Int : Clonglong
 
     # @pycall macro expands correctly
     _pycall = GlobalRef(PyCall,:pycall)
+    @test macroexpand(@__MODULE__, :(@pycall foo()::T)) == :($(_pycall)(foo, T))
+    @test macroexpand(@__MODULE__, :(@pycall foo(; kwargs...)::T)) == :($(_pycall)(foo, T; kwargs...))
     @test macroexpand(@__MODULE__, :(@pycall foo(bar)::T)) == :($(_pycall)(foo, T, bar))
     @test macroexpand(@__MODULE__, :(@pycall foo(bar, args...)::T)) == :($(_pycall)(foo, T, bar, args...))
     @test macroexpand(@__MODULE__, :(@pycall foo(bar; kwargs...)::T)) == :($(_pycall)(foo, T, bar; kwargs...))
diff --git a/test/test_build.jl b/test/test_build.jl
index f55102a..88b7d3f 100644
--- a/test/test_build.jl
+++ b/test/test_build.jl
@@ -4,11 +4,11 @@ include(joinpath(dirname(@__FILE__), "..", "deps", "depsutils.jl"))
 include(joinpath(dirname(@__FILE__), "..", "deps", "buildutils.jl"))
 
 using Test
+using PyCall: python
 
 @testset "find_libpython" begin
-    for python in ["python", "python2", "python3"]
-        # TODO: In Windows, word size should also be checked.
-        Sys.iswindows() && break
+    # TODO: In Windows, word size should also be checked.
+    if !Sys.iswindows()
         if Sys.which(python) === nothing
             @info "$python not available; skipping test"
         else
@@ -37,7 +37,7 @@ using Test
     # Test the case `dlopen` failed to open the library.
     let err, msg
         @test try
-            find_libpython("python"; _dlopen = (_...) -> error("dummy"))
+            find_libpython(python; _dlopen = (_...) -> error("dummy"))
             false
         catch err
             err isa ErrorException
diff --git a/test/test_venv.jl b/test/test_venv.jl
index 0125546..3d24ced 100644
--- a/test/test_venv.jl
+++ b/test/test_venv.jl
@@ -1,5 +1,16 @@
 using PyCall, Test
 
+"""Gets temp directory, possibly with user-set environment variable"""
+function _mktempdir(f::Function, parent=nothing; kwargs...)
+    if parent === nothing && haskey(ENV, "_TMP_DIR")
+        return mktempdir(f, ENV["_TMP_DIR"]; kwargs...)
+    end
+    if parent === nothing
+        parent = tempdir()
+    end
+    return mktempdir(f, parent; kwargs...)
+end
+
 
 function test_venv_has_python(path)
     newpython = PyCall.python_cmd(venv=path).exec[1]
@@ -35,7 +46,7 @@ function test_venv_activation(path)
         # Marking the test broken in Windows.  It seems that
         # venv copies .dll on Windows and libpython check in
         # PyCall.__init__ detects that.
-        @test_broken begin
+        @test begin
             output = read(jlcmd, String)
             sys_executable, exec_prefix, mod_file = split(output, "\n")
             newpython == sys_executable
@@ -57,7 +68,7 @@ end
     elseif Sys.which(pyname) === nothing
         @info "No $pyname command. Skipping the test..."
     else
-        mktempdir() do tmppath
+        _mktempdir() do tmppath
             if PyCall.pyversion.major == 2
                 path = joinpath(tmppath, "kind")
             else
@@ -108,7 +119,7 @@ end
     elseif !success(PyCall.python_cmd(`-c "import venv"`, python=python))
         @info "Skip venv test since venv package is missing."
     else
-        mktempdir() do tmppath
+        _mktempdir() do tmppath
             if PyCall.pyversion.major == 2
                 path = joinpath(tmppath, "kind")
             else