Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
[*] marks changes that break compatibility with previous versions.
Py.Object.get_attr_string
: this function now returns None
when attribute is missing (the former version raised an exception, despite the option
return type and contrary to what was documented). Reported by Lindsay Errington, @dlindsaye, https://github.com/thierry-martinez/pyml/issues/93python
library. Suggested by camlspotter and Et7f3. Use of python-config
. Use of otool -L
instead of ldd
on Mac OS X. https://github.com/thierry-martinez/pyml/issues/91 https://github.com/thierry-martinez/pyml/issues/92find
functions (Py.Object.find
, Py.Object.find_string
, Py.Dict.find
, Py.Dict.find_string
, Py.Object.find_attr_string
and Py.Object.find_attr
) now consistently fail with Not_found
exception, as it is said in the documentation. Functions Py.Object.find_err
, Py.Object.find_string_err
, Py.Object.find_attr_err
, Py.Object.find_attr_string_err
have been introduced for cases where keeping the underlying Python exception is preferable. For instance, Py.Module.get
is now an alias for Py.Object.find_attr_string_err
to keep the current behavior of failing with a Python exception. Reported by Jonathan Laurent, https://github.com/thierry-martinez/pyml/issues/96Py.Run.simple_string
, which now catches all exceptions, including OCaml exceptions. If you need proper exception handling, you can use Py.Run.eval
. (reported by Jerry James, https://github.com/thierry-martinez/pyml/issues/84)Py.Object.dir
.Py.Err.set_interrupt
and, for Python >=3.10, Py.Err.set_interrupt_ex
.Py.Dict.{to_bindings_seq, to_bindings_seq_map, to_bindings_string_seq}
.Py.Capsule.create
, equivalent to Py.Capsule.make
, but returning the record { wrap; unwrap }
of the new type 'a Py.Capsule.t
instead of a pair.python
capture sigint
by default (can be changed by passing ~python_sigint:true
to Py.initialize
): Ctrl+C
now interrupts the program, even after Py.initialize
is called. (reported by Arulselvan Madhavan, https://github.com/thierry-martinez/pyml/issues/83)PyExc_EncodingWarning
(added in Python 3.10), PyExc_ResourceWarning
(added in Python 3.2) (reported by Jerry James, https://github.com/thierry-martinez/pyml/issues/84)PyCompilerFlags
, PyMarshal_WriteObjectToFile
, and PySet_Clear
(reported by Jerry James, https://github.com/thierry-martinez/pyml/issues/84)Numpy.to_bigarray_k
is continuation-passing-style version of Numpy.to_bigarray
, allowing caller to convert Numpy arrays to bigarrays without having to know the kind and the layout of the array (suggested by Lindsay Errington and Andie Sigler, https://github.com/thierry-martinez/pyml/issues/81)Py.Callable.handle_errors
Py.Import.exec_code_module_from_string
(suggested by Francois Berenger, https://github.com/thierry-martinez/pyml/issues/78)Py.Module.compile
provides a better API than Py.compile
.Py.Object.t
can now be serialized (with Marshal or output_value), using Python pickle moduleunix
instead of __linux__
, to handle *BSD OSes (reported by Chris Pinnock, https://github.com/thierry-martinez/pyml/issues/74)Gc.full_major ()
before unloading libpython
in Py.finalize
, to prevent segfaulting on finalizing dangling references to Python values after the library had been unloaded (reported by Denis Efremov on coccinelle mailing list)~debug_build:true
was passed to Py.initialize
(reported by Stéphane Glondu, https://github.com/thierry-martinez/pyml/issues/79)Use dune
as default build system (dunification done by Laurent Mazare, https://github.com/thierry-martinez/pyml/pull/28)
This should in particular fix build problems of reverse dependencies with the byte-code compiler (reported by @nicoTolly, https://github.com/thierry-martinez/pyml/issues/62)
pyutils
is no longer used by generate and is shipped with pyml
package as it was the case with Makefile-based build system (reported by Olaf Hering, https://github.com/thierry-martinez/pyml/issues/69)numpy
(reported by Richard Alligier, https://github.com/thierry-martinez/pyml/pull/65)Py.Array.numpy
arrays on 32-bit platforms (reported by Olaf Hering, https://github.com/thierry-martinez/pyml/pull/70)Compatibility with Python 3.10 (reported by Richard W.M. Jones)
PyObject_AsCharBuffer
, PyObject_AsReadBuffer
, PyObject_AsWriteBuffer
bindings are marked optional as they have been removed in Python 3.10.Py_fopen
is optional and Py_wfopen
is used instead if available.Py.Set
module for Python sets. (Added by Laurent Mazare, https://github.com/thierry-martinez/pyml/pull/58)Numpy.to_bigarray
raises an exception if source value is not a Numpy array instead of segfaulting. (Reported by Jonathan Laurent, https://github.com/thierry-martinez/pyml/issues/61)python-config
heuristics to find Python library. (Reported by Anders Thuné and Nils Becker, https://github.com/thierry-martinez/pyml/issues/56 https://github.com/thierry-martinez/pyml/issues/59)import_module_opt
for Python <3.6 (Reported by opam CI.)__iter__
method to python iterators. (Fixed by Laurent Mazare, https://github.com/thierry-martinez/pyml/pull/47)Py.Seq.{of_seq_map, to_seq_map, unsafe_to_seq_map, of_list, of_list_map}
functions.Py.Import.cleanup
, which has been removed from Python 3.9, and was marked "for internal use only" before. (Reported by Victor Stinner, https://github.com/thierry-martinez/pyml/issues/49)pyml_wrap_closure
(Fixed by Laurent Mazare, https://github.com/thierry-martinez/pyml/pull/53)Py.Module.set_docstring
, for Python >=3.5. (Added by Laurent Mazare, https://github.com/thierry-martinez/pyml/pull/54).cmx
files (Reported by Jonathan Laurent, https://github.com/thierry-martinez/pyml/issues/55)stdcompat.h
provided with stdcompat version 13 for the prototype of caml_alloc_initialized_string
..cmxs
) in METAPy.compile
is a wrapper for the built-in function compile
(Suggested by Dhruv Makwana: https://github.com/thierry-martinez/pyml/issues/25)Py.Object.t
are now documented. New predicates Py.is_none, Py.is_null, Py.Bool.is_true, Py.Bool.is_false, Py.Tuple.is_empty. (Suggested by Laurent Mazare: https://github.com/thierry-martinez/pyml/pull/31)Py.import
is an alias for Py.Import.import_module
.*_opt
naming convention for the functions that return an option instead of an exception: Py.import_opt
, Py.Object.find_opt
,...