On Sat, 23 Apr 2011 13:30:02 -0700, chad wrote:
> On Apr 22, 12:47 pm, Carl Banks wrote:
>> On Thursday, April 21, 2011 11:00:08 AM UTC-7, MRAB wrote:
>> > On 21/04/2011 18:12, Pascal J. Bourguignon wrote:
>> > > chad writes:
>>
>> > >> Let's say I have the following
>>
>> > >> class BaseHan
On Apr 22, 12:47 pm, Carl Banks wrote:
> On Thursday, April 21, 2011 11:00:08 AM UTC-7, MRAB wrote:
> > On 21/04/2011 18:12, Pascal J. Bourguignon wrote:
> > > chad writes:
>
> > >> Let's say I have the following
>
> > >> class BaseHandler:
> > >> def foo(self):
> > >> print "He
On Thursday, April 21, 2011 11:00:08 AM UTC-7, MRAB wrote:
> On 21/04/2011 18:12, Pascal J. Bourguignon wrote:
> > chad writes:
> >
> >> Let's say I have the following
> >>
> >> class BaseHandler:
> >> def foo(self):
> >> print "Hello"
> >>
> >> class HomeHandler(BaseHandler):
>
On Fri, Apr 22, 2011 at 7:49 AM, Kyle T. Jones
wrote:
>> You don't need to create an instance of BaseHandler. You have the
>> class, Python knows you have the class -- Python will look there if the
>> subclasses lack an attribute.
>>
>> ~Ethan~
>>
>
> Really? That's not at all how I thought it w
Kyle T. Jones wrote:
Ethan Furman wrote:
chad wrote:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHandler call foo() when I nev
Ethan Furman wrote:
chad wrote:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHandler call foo() when I never created an instance
MRAB wrote:
On 21/04/2011 18:12, Pascal J. Bourguignon wrote:
chad writes:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHa
On Thu, 21 Apr 2011 19:00:08 +0100, MRAB wrote:
>>> How can HomeHandler call foo() when I never created an instance of
>>> BaseHandler?
>>
>> But you created one!
>>
> No, he didn't, he created an instance of HomeHandler.
>
>> test is an instance of HomeHandler, which is a subclass of BaseHandler
chad wrote:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHandler call foo() when I never created an instance of
BaseHandler?
Yo
On 21/04/2011 18:12, Pascal J. Bourguignon wrote:
chad writes:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHandler call fo
On 4/21/2011 11:43 AM, chad wrote:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHandler call foo() when I never created an ins
chad writes:
> Let's say I have the following
>
> class BaseHandler:
> def foo(self):
> print "Hello"
>
> class HomeHandler(BaseHandler):
> pass
>
>
> Then I do the following...
>
> test = HomeHandler()
> test.foo()
>
> How can HomeHandler call foo() when I never created an in
On Apr 21, 2011 12:55 PM, "chad" wrote:
>
> On Apr 21, 9:30 am, Jean-Michel Pichavant
> wrote:
> > chad wrote:
> > > Let's say I have the following
> >
> > > class BaseHandler:
> > > def foo(self):
> > > print "Hello"
> >
> > > class HomeHandler(BaseHandler):
> > > pass
> >
>
On Apr 21, 9:30 am, Jean-Michel Pichavant
wrote:
> chad wrote:
> > Let's say I have the following
>
> > class BaseHandler:
> > def foo(self):
> > print "Hello"
>
> > class HomeHandler(BaseHandler):
> > pass
>
> > Then I do the following...
>
> > test = HomeHandler()
> > test.fo
chad wrote:
Let's say I have the following
class BaseHandler:
def foo(self):
print "Hello"
class HomeHandler(BaseHandler):
pass
Then I do the following...
test = HomeHandler()
test.foo()
How can HomeHandler call foo() when I never created an instance of
BaseHandler?
Cha
You did:
>>> class BaseHandler:
... def foo(self):
... print "Hello"
...
>>> class HomerHandler(BaseHandler):
... pass
...
>>> test = HomerHandler()
>>> test.foo()
Hello
>>> isinstance(test, BaseHandler)
True
>>> isinstance(test, HomerHandler)
True
>>>
You could say test is a
16 matches
Mail list logo