Re: turning off new-style classes

Sebastien Bigaret <[email protected]> Fri, 2 Jul 2004 16:25:08 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
    Hi John,

  Quick answer, I've no time to check anything w/ Zope by now,
but if you want your classes to be old-style you can modify
Modeling.utils and replace:

try:
    base_object = types.ObjectType
    newclass = 1
except AttributeError:
    class base_object : pass
    newclass = 0

by:

class base_object : pass
newclass = 0

--should work: generated classes inherit from CustomObject which inherits from
base_object.

    HTH!

-- Sébastien.

John Lenton <[email protected]> wrote:
> is there an easy way to revert to 0.9-pre-16 behaviour of creating
> "old-style" classes? zope's security seems to choke on new-style---or
> is there a way to make it work with new-style classes?
> 
> attached is the __init__.py I use in zope... maybe somebody can
> enlighten me on a better way to do it?
> 
> /me is in total newbie mode
> 
> -- 
> John Lenton ([email protected]) -- Random fortune:
> bash: fortune: command not found
> 





-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com