From: Anthony E. <ae...@si...> - 2002-03-26 20:50:39
|
FWIW, the text below would make a good FAQ entry for Java programmers coming to the world of Python wondering about how Strings work in Python. Kevin's explanation was right on track and answered the question succinctly. I am sure that String concatenation is covered in the Python docs, but I still think it would be good to cover this in the Jython docs, primarily because a lot of Java code transfers very easily to Python but some of it (such as for(x in y) and String handling) do not. Perhaps there are other stumbling blocks which Java developers coming to Jython will experience which could also be documented better on the Jython site. What do you think? Sincerely, Anthony Eden > -----Original Message----- > From: jyt...@li... > [mailto:jyt...@li...]On Behalf Of Kevin > Butler > Sent: Tuesday, March 26, 2002 1:53 PM > To: Anthony Eden > Cc: jyt...@li... > Subject: Re: [Jython-users] Supporting + on Java objects > > <snip> > > - In general, the Python string formatting idioms are preferred: > Instead of: > print "text " + obj + ", " + obj2 + "/" + obj3 > use: > print "text %s, %s/%s" % (obj, obj2, obj3) > or: > print "text %(obj)s, %(obj2)s/%(obj3)s" % vars() > |