Am 28.06.2009 um 17:00 schrieb Amit Sethi:
Hi , I don't suppose python has a concept of interfaces. But can
somebody tell me if their is a way i can implement something like a
java interface in python.
The Web Framework Zope has a notion of interfaces.
http://pypi.python.org/pypi/zope.int
"Amit Sethi" wrote
I think ideally i want a compile Error just like java ..
I think you are trying to make Python act like Java which
is always a really bad mistake when using a programming
language. As Bjarne Stroustrup used to say (repeatedly)
"C++ is not Smalltalk". And Python is not
well dir(object) , how would that help . All the functions in base
class would automatically be inherited by the objects of plug-in class
... so they would come in the list even if it was not implemented...
On Mon, Jun 29, 2009 at 5:58 PM, Luke
Paireepinart wrote:
> Amit Sethi wrote:
>>
>> I think
Amit Sethi wrote:
I think ideally i want a compile Error just like java ..
Why? For developers, so they'll know if their plugin meets the
interface requirements?
Have you considered just making a unit test that will call all interface
functions with appropriate parameters? Then they can just
wait even in the above example i would have to run all the functions
in __init__ that is plain stupid ... i was just brain storming
On Mon, Jun 29, 2009 at 5:34 PM, Amit Sethi wrote:
> I think ideally i want a compile Error just like java .. but from the
> discussion here ... i wrote this litt
I think ideally i want a compile Error just like java .. but from the
discussion here ... i wrote this little example:
class a(object):
def __init__(self):
self.query()
try:
if self.query_not_implemented==True:
raise NotImplementedError
excep
Amit Sethi wrote:
Well I want to implement plug-in like mechanism for an application . I want
to define some minimum functions that any body writing a plugin has to
implement. For that i thought an interface would be best because in a
scenario where the function is not implemented some kind of
"Amit Sethi" wrote
Well I want to implement plug-in like mechanism for an application . I
want
to define some minimum functions that any body writing a plugin has to
implement. For that i thought an interface would be best because in a
scenario where the function is not implemented some kind
Well I want to implement plug-in like mechanism for an application . I want
to define some minimum functions that any body writing a plugin has to
implement. For that i thought an interface would be best because in a
scenario where the function is not implemented some kind of error would
occur. I w
"Amit Sethi" wrote
class MyInterface(object):
doSomething(line):
raise NotImplementedError
doSomethingElse(line):
raise NotImplementedError
I think that is exactly the kind of structure i was looking for ...
As a matter of interest, why?
What do you anticipate using this fo
class MyInterface(object):
doSomething(line):
raise NotImplementedError
doSomethingElse(line):
raise NotImplementedError
I think that is exactly the kind of structure i was looking for ...
On Mon, Jun 29, 2009 at 12:58 PM, Andre Engels wrote:
> On Sun, Jun 28, 2009 at 5:00 P
On Sun, Jun 28, 2009 at 5:00 PM, Amit Sethi wrote:
> Hi , I don't suppose python has a concept of interfaces. But can somebody
> tell me if their is a way i can implement something like a java interface
> in python.
Sure. Interfaces are just Java's compensation for not having multiple
inheritance
Bob Rea wrote:
> On Sun June 28 2009 1:48 pm, Alan Gauld wrote:
>> advantages to them over defining, say, a mixin
>
> Noob, here, wanted to know what a mixin is
> eh, just getting back into learning python
> googled it, still not sure what it is, but
> wikipedia says the name come from ice cream m
On Sun June 28 2009 1:48 pm, Alan Gauld wrote:
> advantages to them over defining, say, a mixin
Noob, here, wanted to know what a mixin is
eh, just getting back into learning python
googled it, still not sure what it is, but
wikipedia says the name come from ice cream mixins at
Steve's Ice Cream
"Amit Sethi" wrote
Hi , I don't suppose python has a concept of interfaces.
Yes and No, I'll come back to that...
But can somebody tell me if their is a way i can implement
something like a java interface in python.
First, can you tell me why you would want to?
Java style interfaces tend
Hi , I don't suppose python has a concept of interfaces. But can somebody
tell me if their is a way i can implement something like a java interface
in python.
--
A-M-I-T S|S
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo
16 matches
Mail list logo