summaryrefslogtreecommitdiffstats
path: root/Lib/regexp.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-01-04 09:16:51 (GMT)
committerGuido van Rossum <guido@python.org>1993-01-04 09:16:51 (GMT)
commitfea2af1e9b0c99cac6cb8806c4af651a38e92d07 (patch)
treee9e0ec3b003498ab942e1c0b7dd3d28951ca2701 /Lib/regexp.py
parenta2b7f40513ba5d75a2063c3fabe47377cd8c0416 (diff)
downloadcpython-fea2af1e9b0c99cac6cb8806c4af651a38e92d07.zip
cpython-fea2af1e9b0c99cac6cb8806c4af651a38e92d07.tar.gz
cpython-fea2af1e9b0c99cac6cb8806c4af651a38e92d07.tar.bz2
* More changes due to stricter argument passing rules
* Fixed calendar.py, mimetools.py, whrandom.py to cope with time.time() returning a floating point number. (And fix old bug in calendar) * Add recursion level to mainloop.mainloop(), to make it reentrant.
Diffstat (limited to 'Lib/regexp.py')
-rw-r--r--Lib/regexp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/regexp.py b/Lib/regexp.py
index 2b8a5c0..755f65a 100644
--- a/Lib/regexp.py
+++ b/Lib/regexp.py
@@ -11,11 +11,13 @@ class Prog:
finally:
xxx = regex.set_syntax(save_syntax)
return self
- def match(self, args):
- if type(args) == type(()):
+ def match(self, *args):
+ if len(args) == 2:
str, offset = args
+ elif len(args) == 1:
+ str, offset = args[0], 0
else:
- str, offset = args, 0
+ raise TypeError, 'wrong argument count'
if self.prog.search(str, offset) < 0:
return ()
regs = self.prog.regs