Skip to content

Commit 97f2255

Browse files
committed
equality instead of instanceof
1 parent 618e5b3 commit 97f2255

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/duckdb_py/typing/pytype.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ bool PyUnionType::check_(const py::handle &object) {
2626
if (types_loaded && py::isinstance(object, import_cache.types.UnionType())) {
2727
return true;
2828
}
29-
// for all py3: isinstance(typing.get_origin(object), typing.Union)
29+
// for all py3: typing.get_origin(object) is typing.Union
3030
auto get_origin_func = import_cache.typing.get_origin();
3131
auto origin = get_origin_func(object);
32-
if (py::isinstance(origin, import_cache.typing.Union())) {
32+
if (origin.is(import_cache.typing.Union())) {
3333
return true;
3434
}
3535
return false;

0 commit comments

Comments
 (0)