Re: Does Class implements Interface?

2009-08-30 Thread Emanuele D'Arrigo
Jonathan, Stephen and Max, thank you all for the tips and tricks. Much appreciated. Manu -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Class implements Interface?

2009-08-28 Thread Zvezdan Petkovic
On Aug 27, 2009, at 9:16 AM, Emanuele D'Arrigo wrote: Are there resources such as tools, recipes, documents or strategies that could help me deal with these issues? I've already looked into the ABC module and the zope.interface. I'm just fishing for more things to look at. You say above that

Re: Does Class implements Interface?

2009-08-27 Thread Benjamin Kaplan
On Thu, Aug 27, 2009 at 9:16 AM, Emanuele D'Arrigo man...@gmail.com wrote: Greetings everybody, let's say I have a Class C and I'd like to verify if it implements Interface I. If I is available to me as a class object I can use issubclass(C, I) and I can at least verify that I is a

Re: Does Class implements Interface?

2009-08-27 Thread Jonathan Gardner
On Aug 27, 6:16 am, Emanuele D'Arrigo man...@gmail.com wrote: Greetings everybody, let's say I have a Class C and I'd like to verify if it implements Interface I. If I is available to me as a class object I can use issubclass(C, I) and I can at least verify that I is a superclass of C. There

Re: Does Class implements Interface?

2009-08-27 Thread Emanuele D'Arrigo
On Aug 27, 9:42 pm, Jonathan Gardner jgard...@jonathangardner.net wrote: Have you heard of duck typing? Yes. Ignore all those things and rely on human (aka natural language) documentation. That is, if you want to see if a class will work for an interface, go read the docs on the interface

Re: Does Class implements Interface?

2009-08-27 Thread Jonathan Gardner
On Aug 27, 3:09 pm, Emanuele D'Arrigo man...@gmail.com wrote: Apologies, my fault, No apology is necessary. I didn't explain that humans are out of the loop entirely. It's only at runtime that the program obtains the class object that might or might not conform to an expected interface. In

Re: Does Class implements Interface?

2009-08-27 Thread Jonathan Gardner
On Aug 27, 3:09 pm, Emanuele D'Arrigo man...@gmail.com wrote: On Aug 27, 9:42 pm, Jonathan Gardner jgard...@jonathangardner.net wrote: Have you heard of duck typing? Yes. I was just wondering then if this has been somewhat dealt with and has been wrapped in a neat package, set of

Re: Does Class implements Interface?

2009-08-27 Thread Max Landaeus
Emanuele D'Arrigo wrote: On Aug 27, 9:42 pm, Jonathan Gardner jgard...@jonathangardner.net wrote: Have you heard of duck typing? Yes. Ignore all those things and rely on human (aka natural language) documentation. That is, if you want to see if a class will work for an