mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
fix: can't overload static function.
This commit is contained in:
parent
cdbe55b539
commit
ea7097b0eb
@ -591,10 +591,8 @@ class property : public object {
|
|||||||
object(type::of<property>()(getter, setter)) {}
|
object(type::of<property>()(getter, setter)) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class staticmethod : public object {
|
class staticmethod : public cpp_function {
|
||||||
PKBIND_TYPE_IMPL(object, staticmethod, tp_staticmethod);
|
PKBIND_TYPE_IMPL(cpp_function, staticmethod, tp_staticmethod);
|
||||||
|
|
||||||
staticmethod(handle method) : object(type::of<staticmethod>()(method)) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace impl {
|
namespace impl {
|
||||||
@ -619,8 +617,7 @@ void bind_function(handle obj, const char* name_, Fn&& fn, const Extras&... extr
|
|||||||
py_setdict(
|
py_setdict(
|
||||||
obj.ptr(),
|
obj.ptr(),
|
||||||
name,
|
name,
|
||||||
staticmethod(cpp_function(is_method, name_, std::forward<Fn>(fn), extras...).ptr())
|
staticmethod(is_method, name_, std::forward<Fn>(fn), extras...).ptr());
|
||||||
.ptr());
|
|
||||||
} else {
|
} else {
|
||||||
if constexpr(has_named_args && is_method) {
|
if constexpr(has_named_args && is_method) {
|
||||||
py_setdict(
|
py_setdict(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user