On Thu, 18 Dec 2008 09:34:12 +1000, James Mills wrote:
> On Thu, Dec 18, 2008 at 9:25 AM, Chris Rebert wrote:
>> As I stated previously, the key rule is:
>>
>> eval(repr(something)) == something
>
> This rule is only true for basic data types;
Oops, missed this, and the follow ups.
Note to se
On Wed, 17 Dec 2008 15:25:41 -0800, Chris Rebert wrote:
> 2008/12/17 Li Han :
>> On 12月18日, 上午7时12分, Scott David Daniels
wrote:
>> Scott wrote:
>>> Try: print repr(repr("'"))
>>> that might enlighten you.
>>
>> I found that print( repr( repr( arbitarystring ) ) ) == repr (
>> arbitarystring )
>
On Wed, Dec 17, 2008 at 3:52 PM, Li Han wrote:
> Chris worte:
> [snip]
>> And repr("''") ==> "\"''\""
>> Which when print()-ed is: "''"
>> And eval("''") is the same as entering two apostrophes ('') at the
>> REPL, both of which give an empty string object.
>
> On my machine:
repr("''")
> '"\
Chris worte:
[snip]
> And repr("''") ==> "\"''\""
> Which when print()-ed is: "''"
> And eval("''") is the same as entering two apostrophes ('') at the
> REPL, both of which give an empty string object.
On my machine:
>>> repr("''")
'"\'\'"'
Han
--
http://mail.python.org/mailman/listinfo/python-li
On Wed, Dec 17, 2008 at 3:34 PM, James Mills
wrote:
> On Thu, Dec 18, 2008 at 9:25 AM, Chris Rebert wrote:
>> As I stated previously, the key rule is:
>>
>> eval(repr(something)) == something
>
> This rule is only true for basic data types;
>
> For example:
>
eval(repr(1)) == 1
> True
e
On Thu, Dec 18, 2008 at 9:25 AM, Chris Rebert wrote:
> As I stated previously, the key rule is:
>
> eval(repr(something)) == something
This rule is only true for basic data types;
For example:
>>> eval(repr(1)) == 1
True
>>> eval(repr([1, 2, 3])) == [1, 2, 3]
True
>>> eval(repr({"a": 1, "b": 2,
2008/12/17 Li Han :
> On 12月18日, 上午7时12分, Scott David Daniels wrote:
> Scott wrote:
>> Try: print repr(repr("'"))
>> that might enlighten you.
>
> I found that print( repr( repr( arbitarystring ) ) ) == repr
> ( arbitarystring )
As I stated previously, the key rule is:
eval(repr(something)) ==
On 12月18日, 上午7时12分, Scott David Daniels wrote:
Scott wrote:
> Try: print repr(repr("'"))
> that might enlighten you.
I found that print( repr( repr( arbitarystring ) ) ) == repr
( arbitarystring )
--
http://mail.python.org/mailman/listinfo/python-list
Li Han wrote:
But what repr() do remain a black hole!
Han
Try: print repr(repr("'"))
that might enlighten you.
--
http://mail.python.org/mailman/listinfo/python-list
But what repr() do remain a black hole!
Han
--
http://mail.python.org/mailman/listinfo/python-list
Thank you, Chris! You have made me learn more about Python.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Dec 16, 2008 at 9:32 PM, Li Han wrote:
> Hi! I just began to read the tutorial of python3.0 and I just can't
> figure out the rule of literal string. There is a example in the
> tuotrial:
>>>> '"Isn\'t," she said.'
> '"Isn\
Hi! I just began to read the tutorial of python3.0 and I just can't
figure out the rule of literal string. There is a example in the
tuotrial:
>>> '"Isn\'t," she said.'
'"Isn\'t," she said.'
It is not what I want, I just want '
13 matches
Mail list logo