ssanderson / python-interface

Minimal Pythonic Interface Definitions
https://interface.readthedocs.io/en/latest/
Apache License 2.0
112 stars 16 forks source link

ENH: Add Interface.from_class. #14

Closed ssanderson closed 6 years ago

ssanderson commented 6 years ago

Adds a new classmethod, from_class to Interface, for generating an interface from an existing class. This is useful when you want to create a class whose interface matches the interface of an existing class you can't control (e.g., for creating a test double of class defined in a library).