Skip to content

Commit

Permalink
Merge branch 'PyO3:main' into herquan_cr1
Browse files Browse the repository at this point in the history
  • Loading branch information
herquan committed May 21, 2022
2 parents 5c202c8 + 4869052 commit c5e97e9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/exceptions.rs
Expand Up @@ -5,8 +5,8 @@
//! The structs in this module represent Python's built-in exceptions, while the modules comprise
//! structs representing errors defined in Python code.
//!
//! The latter are created with the [`import_exception`] macro, which you can use yourself
//! to import Python exceptions.
//! The latter are created with the [`import_exception`](crate::import_exception) macro, which you
//! can use yourself to import Python exceptions.

use crate::{ffi, PyResult, Python};
use std::ffi::CStr;
Expand Down
21 changes: 11 additions & 10 deletions src/instance.rs
Expand Up @@ -541,8 +541,9 @@ impl<T> Py<T> {
///
/// This is equivalent to the Python expression `self.attr_name`.
///
/// If calling this method becomes performance-critical, the [`intern!`] macro can be used
/// to intern `attr_name`, thereby avoiding repeated temporary allocations of Python strings.
/// If calling this method becomes performance-critical, the [`intern!`](crate::intern) macro
/// can be used to intern `attr_name`, thereby avoiding repeated temporary allocations of
/// Python strings.
///
/// # Example: `intern!`ing the attribute name
///
Expand Down Expand Up @@ -577,8 +578,8 @@ impl<T> Py<T> {
///
/// This is equivalent to the Python expression `self.attr_name = value`.
///
/// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
/// to intern `attr_name`.
/// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
/// macro can be used to intern `attr_name`.
///
/// # Example: `intern!`ing the attribute name
///
Expand Down Expand Up @@ -660,8 +661,8 @@ impl<T> Py<T> {
///
/// This is equivalent to the Python expression `self.name(*args, **kwargs)`.
///
/// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
/// to intern `name`.
/// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
/// macro can be used to intern `name`.
pub fn call_method<N, A>(
&self,
py: Python<'_>,
Expand Down Expand Up @@ -691,8 +692,8 @@ impl<T> Py<T> {
///
/// This is equivalent to the Python expression `self.name(*args)`.
///
/// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
/// to intern `name`.
/// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
/// macro can be used to intern `name`.
pub fn call_method1<N, A>(&self, py: Python<'_>, name: N, args: A) -> PyResult<PyObject>
where
N: IntoPy<Py<PyString>>,
Expand All @@ -705,8 +706,8 @@ impl<T> Py<T> {
///
/// This is equivalent to the Python expression `self.name()`.
///
/// To avoid repeated temporary allocations of Python strings, the [`intern!`] macro can be used
/// to intern `name`.
/// To avoid repeated temporary allocations of Python strings, the [`intern!`](crate::intern)
/// macro can be used to intern `name`.
pub fn call_method0<N>(&self, py: Python<'_>, name: N) -> PyResult<PyObject>
where
N: IntoPy<Py<PyString>>,
Expand Down
15 changes: 10 additions & 5 deletions src/types/datetime.rs
Expand Up @@ -153,9 +153,9 @@ pub trait PyTimeAccess {
/// Returns whether this date is the later of two moments with the
/// same representation, during a repeated interval.
///
/// This typically occurs at the end of daylight savings time, or during
/// leap seconds. Only valid if the represented time is ambiguous. See
/// [PEP 495](https://www.python.org/dev/peps/pep-0495/) for more detail.
/// This typically occurs at the end of daylight savings time. Only valid if the
/// represented time is ambiguous.
/// See [PEP 495](https://www.python.org/dev/peps/pep-0495/) for more detail.
#[cfg(not(PyPy))]
fn get_fold(&self) -> bool;
}
Expand Down Expand Up @@ -267,7 +267,12 @@ impl PyDateTime {
}

/// Alternate constructor that takes a `fold` parameter. A `true` value for this parameter
/// signifies a leap second
/// signifies this this datetime is the later of two moments with the same representation,
/// during a repeated interval.
///
/// This typically occurs at the end of daylight savings time. Only valid if the
/// represented time is ambiguous.
/// See [PEP 495](https://www.python.org/dev/peps/pep-0495/) for more detail.
#[cfg(not(PyPy))]
#[allow(clippy::too_many_arguments)]
pub fn new_with_fold<'p>(
Expand Down Expand Up @@ -413,7 +418,7 @@ impl PyTime {
}

#[cfg(not(PyPy))]
/// Alternate constructor that takes a `fold` argument
/// Alternate constructor that takes a `fold` argument. See [`PyDateTime::new_with_fold`].
pub fn new_with_fold<'p>(
py: Python<'p>,
hour: u8,
Expand Down

0 comments on commit c5e97e9

Please sign in to comment.