[Python-Dev] C-level duck typing (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Wed May 16 10:11:08 CEST 2012
- Previous message: [Python-Dev] C-level duck typing
- Next message: [Python-Dev] C-level duck typing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Use PyObject_HasAttr, just as people use hasattr() for ducktyping in Python.
If you want something more structured, use Abstract Base Classes, that's what they're for.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] C-level duck typing
- Next message: [Python-Dev] C-level duck typing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]