Skip to content

Commit

Permalink
Python release 1.2.3 (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje authored Mar 10, 2021
1 parent 47eef2a commit c7bb7f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bindings/python/python-bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ py::int_ to_py_int(const BigInteger& value, bool is_signed = true, bool is_bigen
return py::reinterpret_steal<py::int_>(obj);
}

static constexpr auto VERSION_BINDINGS = "1.2.2";
static constexpr auto VERSION_BINDINGS = "1.2.3";

PYBIND11_MODULE(pybiginteger, m) {
m.doc() = "A C++ port of the C# BigInteger class";
Expand Down Expand Up @@ -310,6 +310,10 @@ PYBIND11_MODULE(pybiginteger, m) {
.def("__float__", [](BigInteger& self) { return py::float_(to_py_int(self)); }) // support float() for Python < 3.8
.def("__index__", [](BigInteger& self) { return to_py_int(self); }) // support range()
.def("__str__", &BigInteger::to_string)
.def("__deepcopy__", [](BigInteger& self, py::object memodict) {
BigInteger copy = self;
return copy;
})
.def_static("zero", &BigInteger::zero)
.def_static("one", &BigInteger::one)
.def_static("minus_one", &BigInteger::minus_one)
Expand Down

0 comments on commit c7bb7f7

Please sign in to comment.