[Zope-dev] Syntax error in python2.6

2008-07-21 Thread Bristow Thankachan
Hi everybody,

During the porting of Zope2 to Python2.6, I am stuck with a syntax error in
the module AccessControl, which is given below.

def reorder(s, with=None, without=()):
   ^
SyntaxError: invalid syntax

in line 56 of /home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
The same code when run in python2.4 and python2.5 didn't give any syntax
errors. Can anybody suggest  the reason for this syntax error in python2.6.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Tino Wildenhain

Bristow Thankachan wrote:

Hi everybody,

During the porting of Zope2 to Python2.6, I am stuck with a syntax error 
in the module AccessControl, which is given below.


def reorder(s, with=None, without=()):
   ^
SyntaxError: invalid syntax

in line 56 of /home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
The same code when run in python2.4 and python2.5 didn't give any syntax 
errors. Can anybody suggest  the reason for this syntax error in python2.6.


I'd say, with is now a keyword.

http://docs.python.org/ref/keywords.html

btw, shouldn't this already give a warning in 2.5?

Cheers
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Bristow Thankachan
Thank you for the quick response. I made the change and got the syntax error
corrected.

with regards

Bristow.

On Mon, Jul 21, 2008 at 4:57 PM, Tino Wildenhain [EMAIL PROTECTED] wrote:

 Bristow Thankachan wrote:

 Hi everybody,

 During the porting of Zope2 to Python2.6, I am stuck with a syntax error
 in the module AccessControl, which is given below.

 def reorder(s, with=None, without=()):
   ^
 SyntaxError: invalid syntax

 in line 56 of
 /home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
 The same code when run in python2.4 and python2.5 didn't give any syntax
 errors. Can anybody suggest  the reason for this syntax error in python2.6.


 I'd say, with is now a keyword.

 http://docs.python.org/ref/keywords.html

 btw, shouldn't this already give a warning in 2.5?

 Cheers
 Tino

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Baiju M

How did you change it ?

If you change with there, it may break backward compatibility, I am 
afraid.


Regards,
Baiju M


Bristow Thankachan wrote:
Thank you for the quick response. I made the change and got the syntax 
error corrected.


with regards

Bristow.

On Mon, Jul 21, 2008 at 4:57 PM, Tino Wildenhain [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Bristow Thankachan wrote:

Hi everybody,

During the porting of Zope2 to Python2.6, I am stuck with a
syntax error in the module AccessControl, which is given below.

def reorder(s, with=None, without=()):
  ^
SyntaxError: invalid syntax

in line 56 of
/home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
The same code when run in python2.4 and python2.5 didn't give
any syntax errors. Can anybody suggest  the reason for this
syntax error in python2.6.


I'd say, with is now a keyword.

http://docs.python.org/ref/keywords.html

btw, shouldn't this already give a warning in 2.5?

Cheers
Tino




___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope )
  


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Tino Wildenhain

Hi,


Bristow Thankachan wrote:
...


def reorder(s, with=None, without=()):
  ^
SyntaxError: invalid syntax

in line 56 of
/home/zope/ztrunk26/lib/python/RestrictedPython/Utilities.py.
The same code when run in python2.4 and python2.5 didn't give
any syntax errors. Can anybody suggest  the reason for this
syntax error in python2.6.


I'd say, with is now a keyword.

http://docs.python.org/ref/keywords.html

btw, shouldn't this already give a warning in 2.5?


Actually it does:

python2.5
Python 2.5.2 (r252:60911, Apr 17 2008, 13:15:05)
[GCC 4.2.3 (Debian 4.2.3-3)] on linux2
Type help, copyright, credits or license for more information.
 def foo(with=5):
stdin:1: Warning: 'with' will become a reserved keyword in Python 2.6
... pass
...

So while I'm generally happy with getting zope and python developement
better in sync it seems we have been too fast here since I believe
python2.5 migration is actually still in process and now you are heading
for 2.6? Doing it one after the other should already ruled out such
problems.

I wonder what can of worms is waiting in the restricted python area.

Tino




smime.p7s
Description: S/MIME Cryptographic Signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syntax error in python2.6

2008-07-21 Thread Stephan Richter
On Monday 21 July 2008, Tino Wildenhain wrote:
 btw, shouldn't this already give a warning in 2.5?

It does. I see it.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )