[pypy-svn] r27231 - in pypy/dist/pypy/rpython: . ootypesystem
antocuni at codespeak.net
antocuni at codespeak.net
Mon May 15 13:50:47 CEST 2006
Author: antocuni
Date: Mon May 15 13:50:40 2006
New Revision: 27231
Modified:
pypy/dist/pypy/rpython/ootypesystem/ootype.py
pypy/dist/pypy/rpython/ootypesystem/rstr.py
pypy/dist/pypy/rpython/rstr.py
Log:
Python2.3-ify
Modified: pypy/dist/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/ootype.py (original)
+++ pypy/dist/pypy/rpython/ootypesystem/ootype.py Mon May 15 13:50:40 2006
@@ -834,7 +834,6 @@
else:
raise AttributeError, attr
- @staticmethod
def wrapper(fn):
def f(*args):
res = fn(*args)
@@ -850,6 +849,7 @@
else:
return res
return f
+ wrapper = staticmethod(wrapper)
class _null_string(_null_mixin(_string), _string):
def __init__(self, STRING):
Modified: pypy/dist/pypy/rpython/ootypesystem/rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rstr.py (original)
+++ pypy/dist/pypy/rpython/ootypesystem/rstr.py Mon May 15 13:50:40 2006
@@ -51,12 +51,6 @@
lowleveltype = UniChar
class LLHelpers(AbstractLLHelpers):
-## METHODS = ['ll_stritem_nonneg',
-## 'll_strlen',
-## 'll_strconcat',
-## 'll_startswith',
-## 'll_endswith',
-## ]
def ll_chr2str(ch):
return ootype.oostring(ch)
@@ -88,7 +82,7 @@
if name in LLHelpers.__dict__:
continue
n_args = len(meth.ARGS)
- args = ', '.join('arg%d' % i for i in range(n_args))
+ args = ', '.join(['arg%d' % i for i in range(n_args)])
code = """
def %s(obj, %s):
return obj.%s(%s)
Modified: pypy/dist/pypy/rpython/rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/rstr.py (original)
+++ pypy/dist/pypy/rpython/rstr.py Mon May 15 13:50:40 2006
@@ -517,24 +517,23 @@
def ll_unichar_hash(ch):
return ord(ch)
- @classmethod
def ll_str_is_true(cls, s):
# check if a string is True, allowing for None
return bool(s) and cls.ll_strlen(s) != 0
+ ll_str_is_true = classmethod(ll_str_is_true)
- @classmethod
def ll_stritem_nonneg_checked(cls, s, i):
if i >= cls.ll_strlen(s):
raise IndexError
return cls.ll_stritem_nonneg(s, i)
+ ll_stritem_nonneg_checked = classmethod(ll_stritem_nonneg_checked)
- @classmethod
def ll_stritem(cls, s, i):
if i < 0:
i += cls.ll_strlen(s)
return cls.ll_stritem_nonneg(s, i)
+ ll_stritem = classmethod(ll_stritem)
- @classmethod
def ll_stritem_checked(cls, s, i):
length = cls.ll_strlen(s)
if i < 0:
@@ -542,4 +541,4 @@
if i >= length or i < 0:
raise IndexError
return cls.ll_stritem_nonneg(s, i)
-
+ ll_stritem_checked = classmethod(ll_stritem_checked)
More information about the Pypy-commit
mailing list