[Chicago] How do you troubleshoot cgi errors?
David Rock
david at graniteweb.com
Mon Jul 23 21:38:36 CEST 2007
* Ian Bicking <ianb at colorstudy.com> [2007-07-23 12:56]:
>
> I guess there's a bunch of pieces. There's getattr(), which you can
> read up on here:
> http://www.diveintopython.org/power_of_introspection/getattr.html
>
> I don't see a lot online on __getattr__. Huh. Maybe that's why I
> encounter so many people who are surprised about it. The reference docs
> for that are here: http://python.org/doc/current/ref/attribute-access.html
I have used __getattr__ for a couple things before, but never quite like
this.
> For first class functions you might look at Dive Into Python's
> functional section:
> http://diveintopython.org/functional_programming/index.html
>
> For closures I'm not sure... some of the material out there is really
> more complex than it needs to be. Maybe just reflect on this, the
> simplest of closures:
>
> def make_returner(return_value):
> def returner():
> return return_value
> return returner
>
> x = make_returner(1)
> y = make_returner(2)
> x()
> y()
>
> But I dunno. There's a lot of debate out there about closures,
> functional programming, etc, none of which illuminates the issue. So
> try not to get distracted by that stuff.
As always, thanks for all the info :-)
--
David Rock
david at graniteweb.com
More information about the Chicago
mailing list