|
From: Beecher G. <bee...@ao...> - 2006-10-05 17:25:10
|
What version of Jython are you using? Your example won't work in Jython
2.1, because your code uses new-style classes. Those weren't introduced
until the 2.2 alphas.
Ruchir Talwar wrote:
> Hi,
> Im an avid Jython developer and have been following this dev list for
> some time.
> I have a question about Jython which has bothered me for some time and I
> don't know who to ask.
> It does not belong to the users list because I know it is not possible
> at the moment.
>
>
> class A(object): pass
> A=A() # Ive lost class A
> b=A()
> Traceback (innermost last):
> File "<console>", line 1, in ?
> TypeError: call of non-function ('__main__.A' object)
>
> How do I protect 'A' ?
> Can we not provide a hook when binding a variable to an object in the
> locals(), globals()
>
> something like __localbind__(), __globalbind__()
>
> I saw some post somewhere which said it is not possible in Python and
> that it really isn't something to be concerned about?
>
> Im currently developing a framework in Jython using PyServlet to load
> different web servlets.
> In those servlets I want to be able to make available certain of my own
> datatypes e.g. MO (money), LD (Large decimal) etc
> The problem is that these types can be easily overwritten in the current
> namespace.
>
> I don't think this is a small issue and im definitely concerned about
> failing servlets etc. because a programmer has typed it wrong!
>
> I would like to propose that a hook be given to the programmer so that
> this is not overwritten.
>
> Im sorry if this question does not belong here. Please bear with me and
> do tell me where i should post it if not here?
>
>
> Thanks
> Ruchir
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Jython-dev mailing list
> Jyt...@li...
> https://lists.sourceforge.net/lists/listinfo/jython-dev
|