Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61260

Is It Bug?

Newsgroups comp.lang.python
Date 2013-12-07 16:58 -0800
Message-ID <5865401e-aef8-4dd2-927c-52d2b7ca3ed8@googlegroups.com> (permalink)
Subject Is It Bug?
From Mahan Marwat <mahanmarwat@gmail.com>

Show all headers | View raw


Why this is not working.

>>> 'Hello, \\\\World'.replace('\\', '\\')

To me, Python will interpret '\\\\' to '\\'. And the replace method will replace '\\' with '\'. So, the result will be 'Hello, \World'. But it's give me 'Hello, \\\\World'.

The result I want form the code is 'Hello, \World'.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Is It Bug? Mahan Marwat <mahanmarwat@gmail.com> - 2013-12-07 16:58 -0800
  Re: Is It Bug? Iuri <iurisilvio@gmail.com> - 2013-12-07 23:04 -0200
  Re: Is It Bug? rusi <rustompmody@gmail.com> - 2013-12-07 21:48 -0800
  Re: Is It Bug? Joshua Gardner <mellowcellofellow@gmail.com> - 2013-12-07 23:39 -0700

csiph-web