osdir.com
mailing list archive
Mozy Online Backup: 2GB Free. Automatic. Secure.

Subject: Jython Coding Standards - msg#00069

List: lang.jython.user

Date: Prev Next Index Thread: Prev Next Index
Hi All,   Could anyone please tell me, where can I get the documentation for Coding Standards in Jython? Thanks in advance.   Thanks and regards Saurabh Sharma
*********************************************************
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com

Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Subclassing an Object Dynamically

Say I have something like this: class JythonBar( JavaBar ): def foo( self ): JavaBar.foo( self ) # do something more Is there any way that given an already created instance of JavaBar, that I can turn this into an instance of JythonBar? ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

Next Message by Date: click to view message preview

RE: Subclassing an Object Dynamically

Hi Robert, please correct me if I am wrong, but if I have understood your problem correctly, you want to turn (cast) an object of a class high in the inheritance hierarky into an object of a class lower in the hierarky. This kind of "breaks the rules" when programming with class hierarkies. The point with inheritance is that you can subclass any class to "add or alter functionality", i.e. in most cases an object high in the hierarky will have less, and more general, functionality than a class lower. Hence an object of a class high in the hierarky will lack attributes and functions to behave like the ones lower. If you tried to cast an object high to an object low, you would have to supply the missing information to guarantee correct behaviour. In my oppinion, you should try avoid situations where you want to cast from high to low... If what you want is to alter the behaviour of some UI widget, you should make sure that the widget is created using your class in the first place, or replace the object with a custom-made one... (inheriting from JavaBar). If I have misunderstood your problem, please let me know, and I'll try again... :) Hope this helps! /Bent > -----Original Message----- > From: jython-users-admin@xxxxxxxxxxxxxxxxxxxxx > [mailto:jython-users-admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf > Of Robert DiFalco > Sent: 17. august 2003 20:09 > To: jython-users@xxxxxxxxxxxxxxxxxxxxx > Subject: [Jython-users] Subclassing an Object Dynamically > > > Say I have something like this: > > class JythonBar( JavaBar ): > def foo( self ): > JavaBar.foo( self ) > # do something more > > Is there any way that given an already created instance of > JavaBar, that I can turn this into an instance of JythonBar? > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites > including Data Reports, E-commerce, Portals, and Forums are > available now. Download today and enter to win an XBOX or > Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet _072303_01/01 _______________________________________________ Jython-users mailing list Jython-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

Previous Message by Thread: click to view message preview

RE: Convert PySyntaxError to readable text

Hi Stefan, First of all, how do you get a hold of your error object (the on that you cast to PySyntaxError)? If you get it as an exception from a try catch, you should not need to cast the object to PySyntaxError. Consider: ### // interp = PythonInterpreter object // script = the script with syntax error try { interp.exec(script); } catch (PySyntaxError ex) { System.out.println(ex.toString()); } catch (Exception ex) { } ### My point is, you should be able to call the toString method of you error object and get a textual representation of your syntax error. If I have misunderstood your problem, please specify what I have missed, and I'll try to answer again, if able... Hope this helps, regards /Bent > -----Original Message----- > From: jython-users-admin@xxxxxxxxxxxxxxxxxxxxx > [mailto:jython-users-admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf > Of Stefan Baramov > Sent: 11. august 2003 16:52 > To: jython-users@xxxxxxxxxxxxxxxxxxxxx > Subject: [Jython-users] Convert PySyntaxError to readable text > > > How to convert an instance of PySyntaxError to readable text. > My fist try : > > > PySyntaxError pysyn = (PySyntaxError) error; > String errMsg = exceptions.SyntaxError__str__(new PyObject[] > { pysyn }, null).toString(); > > Failed miserably since PySyntaxError is not a PyObject ( > error is some > Throwable) > > Stefan Baramov > Software Developer > TRX > 6 West Druid Hills Drive > Atlanta, Georgia 30329 > www.trx.com > > email: stefan.baramov@xxxxxxx > office: 404-417-7197 > mobile: 678-575-0933 > > This message is intended only for the use of the Addressee > and may contain information that is PRIVILEGED and > CONFIDENTIAL. If you are not the intended recipient, > dissemination of this communication is prohibited. If you > have received this communication in error, please erase all > copies of the message and its attachments and notify us immediately. > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites > including Data Reports, E-commerce, Portals, and Forums are > available now. Download today and enter to win an XBOX or > Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet _072303_01/01 _______________________________________________ Jython-users mailing list Jython-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

Next Message by Thread: click to view message preview

RE: Convert PySyntaxError to readable text

Hi Bent, Thank you very much. That actually worked excellent. - Stefan -----Original Message----- From: Bent Andre Solheim [mailto:bent@xxxxxxxxxxxxxx] Sent: Monday, August 11, 2003 11:57 AM To: jython-users@xxxxxxxxxxxxxxxxxxxxx Cc: 'Stefan Baramov' Subject: RE: [Jython-users] Convert PySyntaxError to readable text Hi Stefan, First of all, how do you get a hold of your error object (the on that you cast to PySyntaxError)? If you get it as an exception from a try catch, you should not need to cast the object to PySyntaxError. Consider: ### // interp = PythonInterpreter object // script = the script with syntax error try { interp.exec(script); } catch (PySyntaxError ex) { System.out.println(ex.toString()); } catch (Exception ex) { } ### My point is, you should be able to call the toString method of you error object and get a textual representation of your syntax error. If I have misunderstood your problem, please specify what I have missed, and I'll try to answer again, if able... Hope this helps, regards /Bent > -----Original Message----- > From: jython-users-admin@xxxxxxxxxxxxxxxxxxxxx > [mailto:jython-users-admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf > Of Stefan Baramov > Sent: 11. august 2003 16:52 > To: jython-users@xxxxxxxxxxxxxxxxxxxxx > Subject: [Jython-users] Convert PySyntaxError to readable text > > > How to convert an instance of PySyntaxError to readable text. > My fist try : > > > PySyntaxError pysyn = (PySyntaxError) error; > String errMsg = exceptions.SyntaxError__str__(new PyObject[] > { pysyn }, null).toString(); > > Failed miserably since PySyntaxError is not a PyObject ( > error is some > Throwable) > > Stefan Baramov > Software Developer > TRX > 6 West Druid Hills Drive > Atlanta, Georgia 30329 > www.trx.com > > email: stefan.baramov@xxxxxxx > office: 404-417-7197 > mobile: 678-575-0933 > > This message is intended only for the use of the Addressee > and may contain information that is PRIVILEGED and > CONFIDENTIAL. If you are not the intended recipient, > dissemination of this communication is prohibited. If you > have received this communication in error, please erase all > copies of the message and its attachments and notify us immediately. > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites > including Data Reports, E-commerce, Portals, and Forums are > available now. Download today and enter to win an XBOX or > Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet _072303_01/01 _______________________________________________ Jython-users mailing list Jython-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by