[pypy-svn] r13497 - pypy/dist/pypy/rpython
arigo at codespeak.net
arigo at codespeak.net
Fri Jun 17 01:00:36 CEST 2005
Author: arigo
Date: Fri Jun 17 01:00:34 2005
New Revision: 13497
Modified:
pypy/dist/pypy/rpython/normalizecalls.py
Log:
Ignore calls to classes for the purpose of call normalization.
The __init__ methods (in unbound version) are also in the call
families computed by the annotator.
Modified: pypy/dist/pypy/rpython/normalizecalls.py
==============================================================================
--- pypy/dist/pypy/rpython/normalizecalls.py (original)
+++ pypy/dist/pypy/rpython/normalizecalls.py Fri Jun 17 01:00:34 2005
@@ -1,3 +1,4 @@
+import types
from pypy.objspace.flow.model import Variable, Constant, Block, Link
from pypy.objspace.flow.model import SpaceOperation, checkgraph
from pypy.annotation.model import *
@@ -31,8 +32,12 @@
func_family.patterns[pattern] = True
# find the most general signature of each family
for family in call_families.infos():
+ # collect functions in this family, ignoring:
+ # - methods: taken care of above
+ # - classes: their __init__ unbound methods are also families
functions = [func for classdef, func in family.objects
- if classdef is None] # ignore methods now
+ if classdef is None and
+ not isinstance(func, (type, types.ClassType))]
if len(functions) > 1: # otherwise, nothing to do
if len(family.patterns) > 1:
raise TyperError("don't support multiple call patterns "
More information about the Pypy-commit
mailing list