Skip to content

Commit f3ab971

Browse files
committed
third attempt at making windows happy
1 parent ed6b2c5 commit f3ab971

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/duckdb_py/include/duckdb_python/pytype.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class DuckDBPyType : public enable_shared_from_this<DuckDBPyType> {
3030

3131
public:
3232
bool Equals(const shared_ptr<DuckDBPyType> &other) const;
33-
ssize_t HashType() const;
3433
bool EqualsString(const string &type_str) const;
3534
shared_ptr<DuckDBPyType> GetAttribute(const string &name) const;
3635
py::list Children() const;

src/duckdb_py/typing/pytype.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ bool DuckDBPyType::Equals(const shared_ptr<DuckDBPyType> &other) const {
4646
return type == other->type;
4747
}
4848

49-
ssize_t DuckDBPyType::HashType() const {
50-
return py::hash(py::str(ToString()));
51-
}
52-
5349
bool DuckDBPyType::EqualsString(const string &type_str) const {
5450
return StringUtil::CIEquals(type.ToString(), type_str);
5551
}
@@ -334,7 +330,9 @@ void DuckDBPyType::Initialize(py::handle &m) {
334330
py::is_operator());
335331
type_module.def("__eq__", &DuckDBPyType::EqualsString, "Compare two types for equality", py::arg("other"),
336332
py::is_operator());
337-
type_module.def("__hash__", &DuckDBPyType::HashType, "Hashes the type, equal to stringifying+hashing");
333+
type_module.def("__hash__", [](const DuckDBPyType &type) {
334+
return py::hash(py::str(type.ToString()));
335+
});
338336
type_module.def_property_readonly("id", &DuckDBPyType::GetId);
339337
type_module.def_property_readonly("children", &DuckDBPyType::Children);
340338
type_module.def(py::init<>([](const string &type_str, shared_ptr<DuckDBPyConnection> connection = nullptr) {

0 commit comments

Comments
 (0)