Thread: [Pydev-users] [Users] 'with' statement in code analysis?
Brought to you by:
fabioz
From: SourceForge.net <no...@so...> - 2011-04-29 08:36:35
|
The following forum message was posted by at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4509357: The following code yields a number of errors in pydev code analysis: [code]with open('tmp.txt', 'w') as file: pass[/code] I get "undefined variable" for 'with' and 'as', and that 'open' was unexpected. My eclipse project is set to use Python 2.5 grammar. Is the above construct not supported in pydev? Or am I doing something wrong? |
From: SourceForge.net <no...@so...> - 2011-04-29 10:42:37
|
The following forum message was posted by fabioz at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4509357: Python 2.5 doesn't support the with statement unless you add an import for it (Python 2.6 onwards doesn't require it): from __future__ import with_statement Cheers, Fabio |