Hi, thanks for the reply.

No I don't have a particular object that I wanted to extend at the
moment, although sometimes it's an easy way to solve a need or problem
I have. I was going through the new cookbook on the website and saw
the documentation there used old style classes for the Cookie
handling, and then I started browsing through the code and saw that it
was using old style classes.

I was just curious why. I prefer the new style classes. It lets me do
cool stuff like this:

import web
import dal

class Site(object):

    def __new__(cls, *args, **kwds):
        if kwds["path"]:
            try:
                class_ = __import__("pages." + kwds["path"],
fromlist=[kwds["path"]]).Page
            except ImportError:
                web.ctx.status = "404 Not Found"
                class_ = __import__("pages.notfound",
fromlist=["notfound"]).Page
        else:
            class_ = __import__("pages.index",
fromlist=["index"]).Page
        class_.ctx = {
                "type": kwds["type"],
                "path": kwds["path"],
                "input": kwds["input"],
                "db": dal.Dal()
        }
        return class_()

~

On Apr 19, 7:13 pm, "Aaron Swartz" <[EMAIL PROTECTED]> wrote:
> >  class SQLParam:
>
> >  instead of:
>
> >  class SQLParam(object):
>
> Mostly for reasons of concision, I think. Are there particular objects
> that you would like us to make new-style?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to