sprhawk / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Fix string.count #132

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Report from Arduino forum:

The lines 55-60 in t047.py  look like this:
Code:
assert string.count("","") == 0
assert string.count("","a") == 0
assert string.count("a","") == 0
assert string.count("","\0") == 0
assert string.count("\0","\0") == 0
assert string.count("\0","") == 0 

Here's what I got with python 2.4 and python 2.6:

1:  string.count("","")      = 1
2:  string.count("","a")     = 0
3:  string.count("a","")     = 2
4:  string.count("","\0")    = 0
5:  string.count("\0","\0")  = 1
6:  string.count("\0","")    = 2

Original issue reported on code.google.com by dwhall...@gmail.com on 2 Sep 2010 at 4:05