Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cython 缓冲协议 #444

Open
santashen opened this issue Mar 25, 2024 · 0 comments
Open

Cython 缓冲协议 #444

santashen opened this issue Mar 25, 2024 · 0 comments

Comments

@santashen
Copy link
Owner

https://www.windsong.top/Cython%E5%86%85%E5%AD%98%E8%A7%86%E5%9B%BE/?

Cython 缓冲协议 缓冲协议 协议(protocol)是一种接口规范,比如在 Python 中, Cats 类如果实现了 len() 和 getitem() 这两个方法,它就满足了序列协议,就可以被看作是一个序列,我们就可以用 cats[0] 或者 len(cats) 这样的方法来处理 Cats 对象。 Cats 具体是哪个类的子类无关紧要,只需要它满足了对应的协议就可以得到预

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant