Skip to content

Commit a146dc9

Browse files
author
Christopher Rowley
committed
update changelog and docs
1 parent a572c5a commit a146dc9

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
## Unreleased (v1)
44
* The vast majority of these changes are breaking, see the [v1 Migration Guide](@ref) for how to upgrade.
55
* Changes to core functionality:
6-
* Comparisons like `==(::Py, ::Py)`, `<(::Py, ::Number)`, `isless(::Number, ::Py)` now return `Bool` instead of `Py`.
6+
* Comparisons like `==`, `<` and `isless` between `Py`s now return `Bool` instead of `Py`.
7+
* Removed comparisons between `Py` and `Number` (like `Py(3) < 5`).
8+
* Removed arithmetic between `Py` and `Number` (like `Py(2) * 10`).
79
* Changes to `PythonCall.GC` (now more like `Base.GC`):
810
* `enable(true)` replaces `enable()`.
911
* `enable(false)` replaces `disable()`.

docs/src/v1-migration-guide.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,26 @@ Use this guide to help with migrating code from v0.9 to v1.
44

55
## Core functionality
66

7-
Comparisons (`==`, `<`, etc.) between Python objects `Py`, or between `Py` and `Number`,
7+
Comparisons (`==`, `<`, etc.) between Python objects `Py`,
88
used to return `Py` but now return `Bool`. The old behaviour was a pun but broke the
99
Base API behaviour of these functions. These comparisons will now raise an error if the
1010
underlying Python operation does not return `bool`.
1111

1212
* Instead of `pytruth(Py(3) < Py(5))` use `Py(3) < Py(5)`.
1313
* Instead of `Py(3) < Py(5)` use `Py(Py(3) < Py(5))`.
14-
* Instead of `np.array([1,2,3]) < Py(3)` use `pylt(np.array([1,2,3]), Py(3))`. This is
14+
* Instead of `np.array([1,2,3]) < Py(3)` use `pylt(np.array([1,2,3]), 3)`. This is
1515
because comparisons on numpy arrays return arrays of `bool` rather than a single
1616
`bool`.
1717
* Instead of `pylt(Bool, Py(3), Py(5))` you can use `Py(3) < Py(5)`.
1818

19+
Comparisons and arithmetic (`==`, `<`, `+`, `*`, etc.) between `Py` and `Number` have
20+
been removed. The old behaviour broke the PythonCall convention that the boundary
21+
between Python and Julia is explicit.
22+
23+
* Instead of `Py(3) < 10` use `Py(3) < Py(10)` or `pylt(Py(3), 10)`.
24+
* Instead of `Py(5) * 6` use `Py(5) * Py(6)` or `pymul(Py(5), 6)`.
25+
* Instead of `np.array([1,2,3]) < 3` use `pylt(np.array([1,2,3]), 3)`.
26+
1927
## `PythonCall.GC`
2028

2129
This submodule has been changed to closer mimic the `Base.GC` API.

0 commit comments

Comments
 (0)