From b11aac5e8d359af3e8c2b8b7128ec2b12e0d7556 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 4 Nov 2023 11:56:17 -0400 Subject: [PATCH] Use pybind11's typing that was upstreamed --- robotpy_build/include/pybind11_typing.h | 91 +------------------------ 1 file changed, 2 insertions(+), 89 deletions(-) diff --git a/robotpy_build/include/pybind11_typing.h b/robotpy_build/include/pybind11_typing.h index b8800aa6..ed7f6f11 100644 --- a/robotpy_build/include/pybind11_typing.h +++ b/robotpy_build/include/pybind11_typing.h @@ -1,92 +1,5 @@ -/* - pybind11/typing.h: Convenience wrapper classes for basic Python types - with more explicit annotations. - - Copyright (c) 2016 Wenzel Jakob - - All rights reserved. Use of this source code is governed by a - BSD-style license that can be found in the LICENSE file. -*/ #pragma once -#include - -PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) - -/* - The following types can be used to direct pybind11-generated docstrings - to have have more explicit types (e.g., `List[str]` instead of `list`). - Just use these in place of existing types. - - There is no additional enforcement of types at runtime. -*/ - -template -class Tuple : public tuple { - using tuple::tuple; -}; - -template -class Dict : public dict { - using dict::dict; -}; - -template -class List : public list { - using list::list; -}; - -template -class Set : public set { - using set::set; -}; - -template -class Callable; - -template -class Callable : public function { - using function::function; -}; - -PYBIND11_NAMESPACE_BEGIN(detail) - -template -struct handle_type_name> { - static constexpr auto name - = const_name("Tuple[") + concat(make_caster::name...) + const_name("]"); -}; - -template <> -struct handle_type_name> { - // PEP 484 specifies this syntax for an empty tuple - static constexpr auto name = const_name("Tuple[()]"); -}; - -template -struct handle_type_name> { - static constexpr auto name = const_name("Dict[") + make_caster::name + const_name(", ") - + make_caster::name + const_name("]"); -}; - -template -struct handle_type_name> { - static constexpr auto name = const_name("List[") + make_caster::name + const_name("]"); -}; - -template -struct handle_type_name> { - static constexpr auto name = const_name("Set[") + make_caster::name + const_name("]"); -}; - -template -struct handle_type_name> { - using retval_type = conditional_t::value, void_type, Return>; - static constexpr auto name = const_name("Callable[[") + concat(make_caster::name...) - + const_name("], ") + make_caster::name - + const_name("]"); -}; - -PYBIND11_NAMESPACE_END(detail) -PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) +// our changes were merged to upstream +#include