473,225 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

with as a reserved word

I gather that 'with' is on its way to becoming a reserved word. Is
this something that will break?

import Gnuplot
gp = Gnuplot.Gnuplot(debug=1)
data = Gnuplot.Data([1,2,3,4,3,2,3,4,3,2,1], with='linespoints')
gp.plot(data)
>><module1>:3: Warning: 'with' will become a reserved keyword in Python 2.6
http://www.gnuplot.info/
http://gnuplot-py.sourceforge.net/

This was run by PyScripter 1.8.7.1 with Python 2.5.

jab

Jun 11 '07 #1
6 4739
On Jun 11, 10:03 am, BBands <bba...@gmail.comwrote:
I gather that 'with' is on its way to becoming a reserved word. Is
this something that will break?

import Gnuplot
gp = Gnuplot.Gnuplot(debug=1)
data = Gnuplot.Data([1,2,3,4,3,2,3,4,3,2,1], with='linespoints')
gp.plot(data)
><module1>:3: Warning: 'with' will become a reserved keyword in Python 2.6

http://www.gnuplot.info/http://gnupl...urceforge.net/

This was run by PyScripter 1.8.7.1 with Python 2.5.

jab
Looks that way since you can assign anything to 'for' or 'if' or other
reserved words.

Mike

Jun 11 '07 #2
Within gnuplot you can shorten "with" to "w", don't know if it can
work inside a call to Gnuplot.Data()....

francesco

On 6/11/07, BBands <bb****@gmail.comwrote:
I gather that 'with' is on its way to becoming a reserved word. Is
this something that will break?

import Gnuplot
gp = Gnuplot.Gnuplot(debug=1)
data = Gnuplot.Data([1,2,3,4,3,2,3,4,3,2,1], with='linespoints')
gp.plot(data)
><module1>:3: Warning: 'with' will become a reserved keyword in Python2.6

http://www.gnuplot.info/
http://gnuplot-py.sourceforge.net/

This was run by PyScripter 1.8.7.1 with Python 2.5.

jab

--
http://mail.python.org/mailman/listinfo/python-list

--
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as
both victim and villain by the vicissitudes of fate. This visage, no
mere veneer of vanity, is a vestige of the vox populi, now vacant,
vanished. However, this valorous visitation of a bygone vexation
stands vivified, and has vowed to vanquish these venal and virulent
vermin vanguarding vice and vouchsafing the violently vicious and
voracious violation of volition. The only verdict is vengeance; a
vendetta held as a votive, not in vain, for the value and veracity of
such shall one day vindicate the vigilant and the virtuous. Verily,
this vichyssoise of verbiage veers most verbose vis-à-vis an
introduction, so let me simply add that it's my very good honor to
meet you and you may call me V." -- V's introduction to Evey
Jun 11 '07 #3
BBands wrote:
I gather that 'with' is on its way to becoming a reserved word. Is
this something that will break?
yes.
import Gnuplot
gp = Gnuplot.Gnuplot(debug=1)
data = Gnuplot.Data([1,2,3,4,3,2,3,4,3,2,1], with='linespoints')
if you have Python 2.5, you can try it out yourself:
>>dict(with=1)
<stdin>:1: Warning: 'with' will become a reserved keyword in Python 2.6
{'with': 1}
>>from __future__ import with_statement
dict(with=1)
File "<stdin>", line 1
dict(with=1)
^
SyntaxError: invalid syntax

</F>

Jun 11 '07 #4
On Jun 11, 11:34 am, Fredrik Lundh <fred...@pythonware.comwrote:
if you have Python 2.5, you can try it out yourself:
>>dict(with=1)
<stdin>:1: Warning: 'with' will become a reserved keyword in Python 2.6
{'with': 1}
>>from __future__ import with_statement
>>dict(with=1)
File "<stdin>", line 1
dict(with=1)
^
SyntaxError: invalid syntax
I see that this change appears to be final.

http://www.python.org/dev/peps/pep-0343/

I don't have an opinion, pro or con, on this PEP, but I'll bet that it
breaks a lot of code.

jab

Jun 11 '07 #5
BBands wrote:
I don't have an opinion, pro or con, on this PEP, but I'll bet that it
breaks a lot of code.
that's why you get warnings in 2.5, so you have time to update your
code; see:

http://www.python.org/dev/peps/pep-0005/

estimating what "a lot" is isn't trivial, but it's worth noting that a
search for "lang:python \swith\W" over at google's code search only
brings up about 200 cases, and most of those are found in comments and
string literals. and in Zope.

</F>

Jun 11 '07 #6
On Jun 11, 12:47 pm, Fredrik Lundh <fred...@pythonware.comwrote:
estimating what "a lot" is isn't trivial, but it's worth noting that a
search for "lang:python \swith\W" over at google's code search only
brings up about 200 cases, and most of those are found in comments and
string literals. and in Zope.
Well then, it would seem that the problems will be minimal. Good. I'll
have a look a the gnuplot.py code and post heads-up note to their
list.

Thanks,

jab

Jun 11 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Federica T | last post by:
I need to transfer some data from a file .txt to a SQL Server. I use bcp tool. The problem is about a column named 'FILE', that I've declared as: VARCHAR(150) NOT NULL The command I launch...
1
by: James Boulter | last post by:
Dear all, I have a database in which one column is titled 'force'. Now that this has become a reserved word, virtually no commands will execute, including of course a query to change the column...
7
by: millhauser | last post by:
I built my portfolio with Dreamweaver MX. In the bottom frame, I have thumbnails of images. When you click on a thumbnail, it is supposed to load the full size image in a targeted part of the top...
2
by: mark.green | last post by:
Hi folks, I've been trying to write a PLY parser and have run into a bit of bother. At the moment, I have a RESERVEDWORD token which matches all reserved words and then alters the token type...
3
by: VK | last post by:
Just to realease my frustration: innocent "enum" is a reserved word in JScript! !@#$%^&* I occasionally discovered it just before I got ready to smash my computer over my head (some people...
11
by: Roman Werpachowski | last post by:
The following code does not compile: #include <iostream> class close { public: void message(); }; inline void close::message()
31
by: metaperl | last post by:
-- python -i File "<stdin>", line 1 class = "algebra" ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class...
6
by: CTG | last post by:
"update set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007 4:09:59 PM' WHERE ICCID='I1' " UPDATE_FLAG is a YES/NO ICCID is TEXT I have tried YES, NO as well but still fails,
10
by: Stephen.Schoenberger | last post by:
Hello, Sorry if this is not "exactly" a C topic but I thought this would be the best place to start. I need some guidance on working with bitmap images in ANSI C. I need to "read" in a bitmap...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.