Adam Reichold
4baf0235c3
Merge pull request #3616 from neachdainn/3615-gilprotected-pyvisit
...
Enable `GILProtected` access via `PyVisit`
2023-12-05 20:43:38 +00:00
Nathan Kent
3249feb85c
Enable GILProtected
access via PyVisit
...
Closes #3615
This simply adds a new method which uses the existence of a `PyVisit`
object as proof that the GIL is held instead of a `Python` object. This
allows `GILProtected` to be used in instances where contained Python
objects need to participate in garbage collection. Usage in this
situation should be valid since no Python calls are made and this does
not provide any additional mechanism for accessing a `Python` object.
2023-12-05 11:10:00 -08:00
David Hewitt
ed87637ebb
replace PyTryFrom
by splitting PyTypeInfo
2023-12-05 08:01:30 +03:00
David Hewitt
16ae0e2efe
Merge pull request #3608 from wyfo/remove_futures
...
refactor: drop futures_util dependency
2023-12-04 19:17:43 +00:00
Joseph Perez
2ca9f59d6f
refactor: drop futures_util dependency
2023-12-04 18:56:34 +01:00
David Hewitt
e8f852bce7
Merge pull request #3599 from wyfo/coroutine_cancel
...
feat: add `coroutine::CancelHandle`
2023-12-04 12:44:36 +00:00
Joseph Perez
8a674c2bd3
feat: add coroutine::CancelHandle
2023-12-04 07:46:51 +01:00
Adam Reichold
e6457c5e99
Use portable-atomic for targets which lack 64-bit atomics used to check interpreter ID.
...
I chose to make the dependency mandatory instead of optional as portable-atomic
itself just forwards to the native atomics when they are available so making
that choice part of our build system is not really necessary. Personally, I was
unable to perceive any noticeable compile-time hit from adding it.
2023-12-02 07:57:00 +01:00
Alex Gaynor
dd6e0339d3
Refactor create_type_object so that most of the code is monomorphic
...
In pyca/cryptography this function is the #1 source of lines of generated LLVM IR, because it is duplicated 42x (and growing!). By rewriting it so most of the logic is monomorphic, we reduce the generated LLVM IR for this function by 4x.
2023-11-28 20:09:34 -05:00
David Hewitt
5c6d49084f
remove all functionality deprecated in 0.19
2023-11-27 22:02:19 +00:00
David Hewitt
d8002c4b2b
Merge pull request #3588 from wyfo/coroutine_name
...
feat: add coroutine `__name__`/`__qualname__`
2023-11-26 09:23:29 +00:00
Joseph Perez
781b9e3983
feat: add coroutine __name__
/__qualname__
and not-awaited warning
2023-11-25 21:51:20 +01:00
Adam Reichold
1203921d5c
Merge pull request #3456 from aldanor/feature/either
...
Add conversion support for `either::Either`
2023-11-25 09:37:49 +00:00
Adam Reichold
81bc838acd
Merge pull request #3577 from davidhewitt/none-typeinfo
...
Implement `PyTypeInfo` for `PyEllipsis`, `PyNone`, and `PyNotImplemented`
2023-11-25 09:36:43 +00:00
David Hewitt
9f66846238
Merge pull request #3595 from davidhewitt/ok-wrap
...
refactor `OkWrap` to not call `.into_py(py)`
2023-11-25 05:43:54 +00:00
David Hewitt
cd8526ecc6
Implement PyTypeInfo
for PyEllipsis
, PyNone
, and PyNotImplemented
2023-11-24 22:31:39 +00:00
David Hewitt
bead83f4b0
docs: fixup docs for smallvec feature
2023-11-24 22:11:40 +00:00
Ivan Smirnov
a75464ee26
add conversion support for either::Either
2023-11-24 22:09:34 +00:00
David Hewitt
c814078866
refactor OkWrap
to not call .into_py(py)
2023-11-24 10:41:08 +00:00
Joseph Perez
627841f1e2
feat: support async fn
in macros with coroutine implementation
2023-11-22 20:25:36 +01:00
David Hewitt
7b07d6d21b
Merge pull request #3578 from davidhewitt/typed-helpers
...
Change return types of `py.None()`, `py.NotImplemented()` and `py.Ellipsis()` to typed singletons
2023-11-20 07:07:12 +00:00
David Hewitt
bd0174aa5d
Change return types of py.None()
, py.NotImplemented()
and py.Ellipsis()
to typed singletons
2023-11-17 16:16:19 +00:00
David Hewitt
a9305ab389
ci: move lints to new 1.74 cargo.toml tables
2023-11-17 15:41:52 +00:00
Joseph Perez
1fd4090bd4
refactor: remove useless unsafe
in get_mut
2023-10-29 13:50:36 +01:00
Joseph Perez
bb1cc93797
feat: add take
and into_inner
methods to GILOnceCell
2023-10-29 08:33:04 +01:00
David Hewitt
572a27d2d3
ci: fix nightly unused import warnings
2023-10-25 23:30:14 +01:00
David Hewitt
d895734499
change PyDict::from_sequence
to take just &PyAny
2023-10-20 11:59:26 +01:00
David Hewitt
2ca8e573a4
remove comparison to rust-cpython
2023-10-15 22:03:24 +01:00
David Hewitt
f12f928bd5
Merge pull request #3514 from messense/memoryview
...
Add `PyMemoryView` type
2023-10-15 15:08:50 +00:00
David Hewitt
aa28cec893
Merge pull request #3507 from orhun/feat/support_smallvec_conversion
...
Add support for `SmallVec` in conversion traits (#3440 )
2023-10-15 14:43:55 +00:00
messense
f4e64aadef
Add test cases for new TryFrom
impls
2023-10-15 21:53:31 +08:00
messense
d4ed66fff0
Add TryFrom
impls for PyByteArray
and PyMemoryView
2023-10-15 17:39:01 +08:00
messense
5b94241bd7
Add PyMemoryView
type
2023-10-15 17:32:09 +08:00
Orhun Parmaksız
31acf0dc6f
Add an entry to features table in lib
2023-10-13 13:35:30 +03:00
David Hewitt
cac95f31c7
add Py2 as an internal API for optimization and dogfooding
2023-10-13 08:10:37 +02:00
Orhun Parmaksız
dfeae473e5
Add support for SmallVec
in conversion traits ( #3440 )
2023-10-11 17:14:23 +03:00
David Hewitt
e1d4173827
Fix bug in default implementation of __ne__
2023-10-11 09:48:06 +01:00
David Hewitt
76bf521ed0
Merge pull request #3505 from davidhewitt/deprecate_dunder_new
...
deprecate undocumented `#[__new__]` form of `#[new]`
2023-10-10 21:35:10 +00:00
David Hewitt
6c90325a1c
deprecate undocumented #[__new__]
form of #[new]
2023-10-10 08:47:03 +01:00
David Hewitt
c0b5004cfa
Merge pull request #3455 from davidhewitt/normalized-exceptions
...
also use `PyErr::SetObject` on Python versions before 3.12
2023-10-10 07:44:39 +00:00
mejrs
6ca573b9d0
Update clippy
2023-10-06 23:31:06 +02:00
David Hewitt
2daddb4734
unify 3.12 and pre-3.12 exception handling pathways
2023-09-30 23:27:27 +01:00
David Hewitt
f335f42197
Merge pull request #3446 from davidhewitt/relax-import-check
...
relax multiple-import check to only prevent subinterpreters
2023-09-29 16:35:31 +00:00
David Hewitt
b9e9859082
Merge pull request #3478 from mejrs/auto
...
Don't let auto trait syntax bleed through on stable Rust
2023-09-29 16:35:05 +00:00
mejrs
0c8ab98760
move it into the inline module.
2023-09-29 17:22:27 +02:00
David Hewitt
1a349c2eb7
adjust cfgs for windows 3.9
2023-09-29 14:23:18 +01:00
David Hewitt
50cb41dd0b
Merge pull request #3458 from davidhewitt/truncate-leap-seconds
...
truncate leap seconds on `chrono` to `datetime` conversions
2023-09-29 11:47:27 +00:00
David Hewitt
4b5ff05721
Merge pull request #3471 from davidhewitt/normalized-exceptions-2
...
always normalize exceptions before raising
2023-09-28 20:27:18 +00:00
mejrs
d0d4b9d3fb
Dont let auto trait syntax bleed through on stable
2023-09-28 12:26:09 +02:00
David Hewitt
0459532f69
truncate leap seconds on chrono
to datetime
conversions
2023-09-24 20:28:43 +01:00