View Full Version : python: values to strings

02-26-2004, 09:25 PM
If anyone has the 2.3.3 python documentation then you can find this in the tutorials on number 7. if you dont then i hope you know what i am talking about.

a part of the page says this:
"One question remains, of course: how do you convert values to strings? Luckily, Python has ways to convert any value to a string: pass it to the repr() or str() functions. Reverse quotes (``) are equivalent to repr(), but their use is discouraged. "

2.3.3 is the most updated version of python yet they discourage the use of repr() and str() functions.. What do i use in replacement of those functions?

02-26-2004, 10:50 PM
Uhm... *scratches his head*

Are you sure you put the last sentence into the right context? I read it as if the backticks (reverse quotes) were meant with "their use", and that they (the reverse quotes) should not be used. AFAIK know, using str() and repr() is fine.

02-27-2004, 09:17 PM
yes mordred that last sentense is correct..unless you have the 2.3.3 documentation of python, dont know how else to explain it.
no big deal ;)

02-27-2004, 09:24 PM
I understand objects, and methods but properties are something that i cant seem to grasp at why they are so important..

for example:

"car" is the object and "red" would be a property of the car..so would leather seats. Why do the properties matter..as long as the object does what its susposed to do?.

properties such as the color and type of seats dont affect the performance of the car..