Problem in parsing python decorator @classmethod

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in parsing python decorator @classmethod

Shyam-4
Hi All,
               I am fairly new to Python and Jython. I am using Python 2.4 and Jython 2.2b1. I have been running few test programs and I found that Jython interpreter fails when it encounters a @classmethod decorator in a Python file. The error message is
 
Traceback (innermost last):
  File "D:\JythonTest\deco.py", line 19, in ?
  File "D:\JythonTest\java.py", line 2, in ?
  File "D:\JythonTest\myapp.py", line 960
     @classmethod
     ^
SyntaxError: Lexical error at line 960, column 5.  Encountered: "@" (64), after : ""
 
One of the possible solutions could be to change the classmethod declaration to the old fashined way of using classmethod() function. But I would still like to know if I can have the problem addressed by still retaining the @classmethod decorator.
 
Please help!!
 
Thanks,
Junkie
 

-------------------------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem in parsing python decorator @classmethod

Leo User
jython doesn't have decorators.  When jythonx is open
to public viewing you should be able to play with
decorators to your hearts content.  They seem like
such a simple construct that adds alot of potential
power.

leouser


--- Shyam <[hidden email]> wrote:

> Hi All,
>                I am fairly new to Python and Jython.
> I am using Python
> 2.4and Jython
> 2.2b1. I have been running few test programs and I
> found that Jython
> interpreter fails when it encounters a @classmethod
> decorator in a Python
> file. The error message is
>
> Traceback (innermost last):
>   File "D:\JythonTest\deco.py", line 19, in ?
>   File "D:\JythonTest\java.py", line 2, in ?
>   File "D:\JythonTest\myapp.py", line 960
>      @classmethod
>      ^
> SyntaxError: Lexical error at line 960, column 5.
> Encountered: "@" (64),
> after : ""
>
> One of the possible solutions could be to change the
> classmethod declaration
> to the old fashined way of using classmethod()
> function. But I would still
> like to know if I can have the problem addressed by
> still retaining the
> @classmethod decorator.
>
> Please help!!
>
> Thanks,
> Junkie
> >
-------------------------------------------------------------------------
> 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-users mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/jython-users
>



 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

-------------------------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem in parsing python decorator @classmethod

fwierzbicki@gmail.com
In reply to this post by Shyam-4
On 3/12/07, Shyam <[hidden email]> wrote:
> Hi All,
>                I am fairly new to Python and Jython. I am using Python 2.4
> and Jython 2.2b1. I have been running few test programs and I found that
> Jython interpreter fails when it encounters a @classmethod decorator in a
> Python file. The error message is
Jython 2.2 does not have decorators.  The next Jython version will
(hopefully will get decorators in the new branch pretty soon.)

-Frank

-------------------------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users