with as a reserved word

F

Francesco Guerrieri

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

francesco

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)

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

This was run by PyScripter 1.8.7.1 with Python 2.5.

jab


--
"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
 
F

Fredrik Lundh

BBands said:
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:
File "<stdin>", line 1
dict(with=1)
^
SyntaxError: invalid syntax

</F>
 
F

Fredrik Lundh

BBands said:
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>
 
B

BBands

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top