mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-18 14:40:49 +00:00
Merge branch 'pybind:master' into master
This commit is contained in:
commit
bb6ae5013c
@ -10,6 +10,7 @@ cppcoreguidelines-pro-type-static-cast-downcast,
|
|||||||
cppcoreguidelines-slicing,
|
cppcoreguidelines-slicing,
|
||||||
google-explicit-constructor,
|
google-explicit-constructor,
|
||||||
llvm-namespace-comment,
|
llvm-namespace-comment,
|
||||||
|
misc-definitions-in-headers,
|
||||||
misc-misplaced-const,
|
misc-misplaced-const,
|
||||||
misc-non-copyable-objects,
|
misc-non-copyable-objects,
|
||||||
misc-static-assert,
|
misc-static-assert,
|
||||||
@ -17,6 +18,7 @@ misc-throw-by-value-catch-by-reference,
|
|||||||
misc-uniqueptr-reset-release,
|
misc-uniqueptr-reset-release,
|
||||||
misc-unused-parameters,
|
misc-unused-parameters,
|
||||||
modernize-avoid-bind,
|
modernize-avoid-bind,
|
||||||
|
modernize-loop-convert,
|
||||||
modernize-make-shared,
|
modernize-make-shared,
|
||||||
modernize-redundant-void-arg,
|
modernize-redundant-void-arg,
|
||||||
modernize-replace-auto-ptr,
|
modernize-replace-auto-ptr,
|
||||||
@ -63,6 +65,8 @@ readability-uniqueptr-delete-release,
|
|||||||
CheckOptions:
|
CheckOptions:
|
||||||
- key: performance-for-range-copy.WarnOnAllAutoCopies
|
- key: performance-for-range-copy.WarnOnAllAutoCopies
|
||||||
value: true
|
value: true
|
||||||
|
- key: performance-inefficient-string-concatenation.StrictMode
|
||||||
|
value: true
|
||||||
- key: performance-unnecessary-value-param.AllowedTypes
|
- key: performance-unnecessary-value-param.AllowedTypes
|
||||||
value: 'exception_ptr$;'
|
value: 'exception_ptr$;'
|
||||||
- key: readability-implicit-bool-conversion.AllowPointerConditions
|
- key: readability-implicit-bool-conversion.AllowPointerConditions
|
||||||
|
@ -32,7 +32,7 @@ repos:
|
|||||||
|
|
||||||
# Upgrade old Python syntax
|
# Upgrade old Python syntax
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: "v2.32.1"
|
rev: "v2.33.0"
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py36-plus]
|
args: [--py36-plus]
|
||||||
@ -59,7 +59,7 @@ repos:
|
|||||||
|
|
||||||
# Changes tabs to spaces
|
# Changes tabs to spaces
|
||||||
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
||||||
rev: "v1.1.13"
|
rev: "v1.2.0"
|
||||||
hooks:
|
hooks:
|
||||||
- id: remove-tabs
|
- id: remove-tabs
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ repos:
|
|||||||
|
|
||||||
# Autoremoves unused imports
|
# Autoremoves unused imports
|
||||||
- repo: https://github.com/hadialqattan/pycln
|
- repo: https://github.com/hadialqattan/pycln
|
||||||
rev: "v1.3.2"
|
rev: "v1.3.3"
|
||||||
hooks:
|
hooks:
|
||||||
- id: pycln
|
- id: pycln
|
||||||
stages: [manual]
|
stages: [manual]
|
||||||
@ -107,7 +107,7 @@ repos:
|
|||||||
|
|
||||||
# PyLint has native support - not always usable, but works for us
|
# PyLint has native support - not always usable, but works for us
|
||||||
- repo: https://github.com/PyCQA/pylint
|
- repo: https://github.com/PyCQA/pylint
|
||||||
rev: "v2.13.8"
|
rev: "v2.14.1"
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
files: ^pybind11
|
files: ^pybind11
|
||||||
@ -123,7 +123,7 @@ repos:
|
|||||||
|
|
||||||
# Check static types with mypy
|
# Check static types with mypy
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: "v0.950"
|
rev: "v0.960"
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
args: []
|
args: []
|
||||||
|
@ -753,7 +753,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// type number of dtype.
|
/// type number of dtype.
|
||||||
ssize_t num() const {
|
int num() const {
|
||||||
// Note: The signature, `dtype::num` follows the naming of NumPy's public
|
// Note: The signature, `dtype::num` follows the naming of NumPy's public
|
||||||
// Python API (i.e., ``dtype.num``), rather than its internal
|
// Python API (i.e., ``dtype.num``), rather than its internal
|
||||||
// C API (``PyArray_Descr::type_num``).
|
// C API (``PyArray_Descr::type_num``).
|
||||||
|
@ -31,8 +31,8 @@ py::bytes return_bytes() {
|
|||||||
std::string print_bytes(const py::bytes &bytes) {
|
std::string print_bytes(const py::bytes &bytes) {
|
||||||
std::string ret = "bytes[";
|
std::string ret = "bytes[";
|
||||||
const auto value = static_cast<std::string>(bytes);
|
const auto value = static_cast<std::string>(bytes);
|
||||||
for (size_t i = 0; i < value.length(); ++i) {
|
for (char c : value) {
|
||||||
ret += std::to_string(static_cast<int>(value[i])) + " ";
|
ret += std::to_string(static_cast<int>(c)) + ' ';
|
||||||
}
|
}
|
||||||
ret.back() = ']';
|
ret.back() = ']';
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user