Message2228

Author otmarhumbel
Recipients
Date 2002-03-13.21:36:40
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The recent discussion 
http://www.geocrawler.com/lists/3/SourceForge/7017/0/80
83538/
made me believe that maybe string.replace() could be a 
little more tolerant.

Add the following lines to string.py:

  import sys
  sys.add_package( "java.lang" )
  from java.lang import String

and change the replace method as follows:

  # Substring replacement (global)
  def replace(s, old, new, maxsplit=-1):
      """<unchanged>"""
      if isinstance( s, String ):
          return s.intern().replace(old, new, maxsplit)
      else:
          return s.replace(old, new, maxsplit)

Best wishes,
Oti.
History
Date User Action Args
2008-02-20 17:18:18adminlinkissue529629 messages
2008-02-20 17:18:18admincreate