dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.

Home Page:http://pydash.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Checking if `_Dash` is an instance of a `Protocol` results in raised `InvalidMethod`.

kennipj opened this issue · comments

Checking if _Dash is an instance of a runtime checkable Protocol raises InvalidMethod.

Code sample:

from typing import Protocol, runtime_checkable
from pydash import py_

@runtime_checkable
class SomeProtocol(Protocol):
    some_field: int


isinstance(py_, SomeProtocol)
# pydash.exceptions.InvalidMethod: Invalid pydash method: some_field

Tested with:

  • python 3.8.5 and python 3.9.6
  • pydash 5.0.1