Commit Graph

41 Commits

Author SHA1 Message Date
David Hewitt 3295e35a4b accept any iterator for `PySet::new` and `PyFrozenSet::new` 2022-12-04 09:54:34 +00:00
ijl d5a31706c6 Define _PyErr_ChainExceptions() FFI for CPython
This appears to be the only way to chain exceptions via the FFI. It
was introduced prior to CPython 3.7. It has some description of usage
in PEP 490. There was a discussion of whether it should be made stable
in BPO 44938.
2022-12-01 15:25:56 +00:00
David Hewitt 97487ffbb5 add abi3-py311 feature 2022-11-23 08:08:12 +00:00
Georg Brandl cbae47d171 PySlice: fix isize->long truncation in initialization
Fixes #2768
2022-11-22 12:04:32 +01:00
David Hewitt 8ca41be87b
Merge pull request #2749 from PyO3/2748-fix
Fix being able to call arg-less `#[new]` with any args from Python
2022-11-20 11:39:42 +00:00
Georg Brandl ea9da80ab1 macros: fix the check for applying `METH_NOARGS`
to only consider the Python argument list.

Fixes #2750
2022-11-20 09:00:42 +01:00
Georg Brandl 2a630a2a52 Fix being able to call arg-less `#[new]` with any args from Python
Fixes #2748
2022-11-20 08:25:19 +01:00
Georg Brandl 249c0209fd Add {Py,PyAny}::downcast_unchecked to replace try_from_unchecked calls 2022-11-18 07:00:40 +01:00
Georg Brandl 7d4dfc32b3 PyAny::downcast(): relax lifetime bounds 2022-11-18 07:00:40 +01:00
Georg Brandl c489809938 Py/PyAny: deprecate cast_as() in favor of downcast()
They are (practically) identical on PyAny, and `downcast()` is the more
useful name.
2022-11-18 07:00:40 +01:00
Georg Brandl 1d20f2a531
Export warning classes and add PyErr::warn_explicit() (#2742) 2022-11-17 19:30:48 +01:00
Chih Wang d060a19303
Add support for std::num::NonZero integer types (#2730) 2022-11-13 10:54:55 +00:00
messense dee791de90
`pyo3-build-config`: rebuild when `PYO3_ENVIRONMENT_SIGNATURE` value changed 2022-11-09 20:28:18 +08:00
David Hewitt 4b7e0ee5b4
Merge pull request #2685 from alex/type-error
Use a TypeError, rather than a ValueError, when refusing to treat a str as a Vec
2022-11-09 07:36:40 +00:00
Itamar Turner-Trauring 6746ff8216
Python 3.7 support for PyCodeObject. (#2726)
* Python 3.7 support for PyCodeObject.

Co-authored-by: Itamar Turner-Trauring <itamar@pythonspeed.com>
2022-11-08 21:06:05 +00:00
Alex Gaynor f7a487b809
Use a TypeError, rather than a ValueError, when refusing to treat a str as a Vec
This is far more consistent with how these exceptions are usually used
2022-11-07 07:48:13 -05:00
Bruno Kolenbrander 6766d9f93b
Merge pull request #2686 from dalcde/closure-name-doc
Support passing name and doc to new_closure.
2022-11-06 17:35:20 +01:00
David Hewitt 548e90fcec release: 0.17.3 2022-11-01 20:47:46 +00:00
messense 736e97556d
Disable `PyModule::filename` on PyPy 2022-10-31 15:45:50 +08:00
Dexter Chua 9201a7dd48 Support passing name and doc to PyCFunction::new_closure. Fixes #2665 2022-10-29 12:26:09 +08:00
David Hewitt 0bd261c7d1 packaging: support Python 3.11 2022-10-27 07:44:50 +01:00
David Hewitt 8e8b484169
add `#[pyo3(signature = (...))]` attribute (#2702) 2022-10-25 07:23:21 +01:00
David Hewitt 747d791f1f
introduce trampolines for methods (#2705) 2022-10-25 07:22:36 +01:00
David Hewitt 39a68cf7ac
Merge pull request #2687 from saethlin/main
Avoid calling slice::from_raw_parts with a null pointer
2022-10-20 07:34:39 +01:00
Ben Kimock 7ff5ab770a Avoid calling slice::from_raw_parts with a null pointer 2022-10-18 17:09:27 -04:00
David Hewitt 446c0e82f0
Merge pull request #2692 from mejrs/all
Implement get/set all on pyclass
2022-10-18 21:39:44 +01:00
mejrs 3b687b7012 newsfragment 2022-10-18 21:40:59 +02:00
Georg Brandl 676227d2a1
Make `is_instance()` and `is_subclass()` take `&PyAny` (#2695) 2022-10-18 19:22:23 +02:00
Bruno Kolenbrander 4a04603c2c
Don't use intocallback in method macros (#2664)
* Don't use intocallback in method macros

Co-authored-by: mejrs <>
2022-10-16 10:35:58 +01:00
David Hewitt 125af9b7de
Merge pull request #2676 from PyO3/exact-iter
Add more implementations of ExactSizeIterator when iterating built-in Python data structures.
2022-10-13 21:28:04 +01:00
Adam Reichold f456ed7586 Also relax the PySequence check when extracting fixed-sized arrays. 2022-10-13 09:43:45 +02:00
Adam Reichold cd361dc5cc Add more implementations of ExactSizeIterator when iterating built-in Python data structures. 2022-10-11 18:21:02 +02:00
David Hewitt bd40011e93 release: 0.17.2 2022-10-04 08:13:53 +01:00
Federico Dolce 63f7df905d
Add chrono 0.4 integration (#2612)
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-09-22 09:00:09 +02:00
David Hewitt 81a79778a2
Merge pull request #2631 from PyO3/relax-extract-sequence-pre-0.17
Relax extract_sequence to the status quo before 0.17 was released
2022-09-21 11:52:34 +02:00
David Hewitt a0be791577
Merge pull request #2630 from davidhewitt/option-pyclass-arg
pyfunction: fix compile error for Option<&T> argument with a default
2022-09-21 11:44:55 +02:00
Adam Reichold 0c30cba57a Add changelog entry detailing which behaviour change this does and does not revert. 2022-09-21 09:50:57 +02:00
David Hewitt c445eba28d pyfunction: fix compile error for Option<&T> argument with a default 2022-09-20 15:44:55 +02:00
Mario Rugiero d72989f986
Enable BigInt conversion for PyPy (#2626)
* Enable bigint conversion for PyPy

* Update src/conversions/num_bigint.rs

* Add a changelog entry for PyPy `num-bigint` support

Co-authored-by: messense <messense@icloud.com>
2022-09-20 18:55:14 +08:00
Jonathan Coates 73242f0ee3
Add release notes 2022-09-19 14:21:28 +01:00
David Hewitt bb99c98ec1 use towncrier to generate CHANGELOG 2022-09-08 07:58:53 +01:00