Re: [Tutor] Class Extend Help

2008-12-20 Thread Martin Walsh
Omer wrote: > Hey. > > I'm trying to do something I think is basic and am failing. > > The goal is: > [mimicking the google urlopen syntax] > > try: > from google.appengine.api.urlfetch import fetch > except: > from urllib import urlopen as fetch > > > How do I add this "fetch" the

Re: [Tutor] Class Extend Help

2008-12-20 Thread Richard Lovely
There are three ways as I see it: using __getattr__, using a new init, or using a property decorator. The last two are probably the most pythonic, but I'm not familiar with decorators, so here's how I'd do the second of the three: try: from google.appengine.api.urlfetch import fetch except:

[Tutor] Class Extend Help

2008-12-20 Thread Omer
Hey. I'm trying to do something I think is basic and am failing. The goal is: [mimicking the google urlopen syntax] try: from google.appengine.api.urlfetch import fetch except: from urllib import urlopen as fetch How do I add this "fetch" the property of content? I basically want fetc