[pypy-svn] r31190 - in pypy/dist/pypy: interpreter interpreter/pyparser interpreter/pyparser/test interpreter/test jit/codegen/i386 jit/timeshifter lib/pyontology/test module/__builtin__ module/_socket module/bz2 module/recparser module/recparser/test objspace/cpy rpython/lltypesystem rpython/numpy rpython/ootypesystem tool/pytest translator/backendopt translator/c translator/cli translator/goal translator/js/demo/jsdemo translator/microbench/pybench

arigo at codespeak.net arigo at codespeak.net
Wed Aug 9 12:16:24 CEST 2006


Author: arigo
Date: Wed Aug  9 12:16:17 2006
New Revision: 31190

Modified:
   pypy/dist/pypy/interpreter/pycompiler.py
   pypy/dist/pypy/interpreter/pyparser/astbuilder.py
   pypy/dist/pypy/interpreter/pyparser/ebnflexer.py
   pypy/dist/pypy/interpreter/pyparser/ebnfparse.py
   pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py
   pypy/dist/pypy/interpreter/test/test_objspace.py
   pypy/dist/pypy/jit/codegen/i386/autotest.py
   pypy/dist/pypy/jit/timeshifter/rtyper.py
   pypy/dist/pypy/lib/pyontology/test/test_ontology.py
   pypy/dist/pypy/module/__builtin__/importing.py
   pypy/dist/pypy/module/_socket/interp_socket.py
   pypy/dist/pypy/module/bz2/interp_bz2.py
   pypy/dist/pypy/module/recparser/pyparser.py
   pypy/dist/pypy/module/recparser/test/test_compilehooks.py
   pypy/dist/pypy/objspace/cpy/objspace.py
   pypy/dist/pypy/rpython/lltypesystem/rclass.py
   pypy/dist/pypy/rpython/numpy/aarray.py
   pypy/dist/pypy/rpython/ootypesystem/rclass.py
   pypy/dist/pypy/tool/pytest/genreportdata.py
   pypy/dist/pypy/translator/backendopt/merge_if_blocks.py
   pypy/dist/pypy/translator/c/gc.py
   pypy/dist/pypy/translator/cli/database.py
   pypy/dist/pypy/translator/goal/gcbench.py
   pypy/dist/pypy/translator/js/demo/jsdemo/servermessage.py
   pypy/dist/pypy/translator/microbench/pybench/pybench.py
Log:
Massive untabify.


Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py	(original)
+++ pypy/dist/pypy/interpreter/pycompiler.py	Wed Aug  9 12:16:17 2006
@@ -250,5 +250,5 @@
 
 def install_compiler_hook(space, w_callable):
 #       if not space.get( w_callable ):
-#	    raise OperationError( space.w_TypeError( space.wrap( "must have a callable" ) )
+#           raise OperationError( space.w_TypeError( space.wrap( "must have a callable" ) )
         space.default_compiler.w_compile_hook = w_callable

Modified: pypy/dist/pypy/interpreter/pyparser/astbuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/astbuilder.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/astbuilder.py	Wed Aug  9 12:16:17 2006
@@ -1303,8 +1303,8 @@
         names.append((name, as_name))
         # move forward until next ','
         # XXX: what is it supposed to do ?
-	while index<l:
-	    atom = atoms[index]
+        while index<l:
+            atom = atoms[index]
 #        for atom in atoms[index:]:
             if isinstance(atom, TokenObject) and atom.name == tok.COMMA:
                 break

Modified: pypy/dist/pypy/interpreter/pyparser/ebnflexer.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/ebnflexer.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/ebnflexer.py	Wed Aug  9 12:16:17 2006
@@ -137,8 +137,8 @@
             if npos==end and inp[end-1]!="'":
                 self.RaiseError("Unterminated string")
             self.pos = npos
-	    _endpos = npos - 1
-	    assert _endpos>=0
+            _endpos = npos - 1
+            assert _endpos>=0
             return Token(TOK_STRING,inp[pos+1:_endpos])
         else:
             npos = match_symbol( inp, pos, end)

Modified: pypy/dist/pypy/interpreter/pyparser/ebnfparse.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/ebnfparse.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/ebnfparse.py	Wed Aug  9 12:16:17 2006
@@ -70,17 +70,17 @@
 
 def ebnf_handle_grammar(self, node):
     for rule in node.nodes:
-	rule.visit(self)
+        rule.visit(self)
     # the rules are registered already
     # we do a pass through the variables to detect
     # terminal symbols from non terminals
     for r in self.items:
-	for i,a in enumerate(r.args):
-	    if a.codename in self.rules:
-		assert isinstance(a,Token)
-		r.args[i] = self.rules[a.codename]
-		if a.codename in self.terminals:
-		    del self.terminals[a.codename]
+        for i,a in enumerate(r.args):
+            if a.codename in self.rules:
+                assert isinstance(a,Token)
+                r.args[i] = self.rules[a.codename]
+                if a.codename in self.terminals:
+                    del self.terminals[a.codename]
     # XXX .keywords also contains punctuations
     self.terminals['NAME'].keywords = self.keywords
 
@@ -91,14 +91,14 @@
     alt = node.nodes[1]
     rule = alt.visit(self)
     if not isinstance(rule, Token):
-	rule.codename = self.symbols.add_symbol( symdef )
+        rule.codename = self.symbols.add_symbol( symdef )
     self.rules[rule.codename] = rule
 
 def ebnf_handle_alternative(self, node):
     items = [node.nodes[0].visit(self)]
     items += node.nodes[1].visit(self)        
     if len(items) == 1 and not items[0].is_root():
-	return items[0]
+        return items[0]
     alt = Alternative(self.new_symbol(), items)
     return self.new_item(alt)
 
@@ -106,11 +106,11 @@
     """ """
     items = []
     for n in node.nodes:
-	items.append( n.visit(self) )
+        items.append( n.visit(self) )
     if len(items)==1:
-	return items[0]
+        return items[0]
     elif len(items)>1:
-	return self.new_item( Sequence( self.new_symbol(), items) )
+        return self.new_item( Sequence( self.new_symbol(), items) )
     raise RuntimeError("Found empty sequence")
 
 def ebnf_handle_sequence_cont( self, node ):
@@ -126,13 +126,13 @@
     sym = node.nodes[0].value
     terminal = self.terminals.get( sym, None )
     if not terminal:
-	tokencode = pytoken.tok_values.get( sym, None )
-	if tokencode is None:
-	    tokencode = self.symbols.add_symbol( sym )
-	    terminal = Token( tokencode )
-	else:
-	    terminal = Token( tokencode )
-	    self.terminals[sym] = terminal
+        tokencode = pytoken.tok_values.get( sym, None )
+        if tokencode is None:
+            tokencode = self.symbols.add_symbol( sym )
+            terminal = Token( tokencode )
+        else:
+            terminal = Token( tokencode )
+            self.terminals[sym] = terminal
 
     return self.repeat( star_opt, terminal )
 
@@ -148,15 +148,15 @@
     value = node.value
     tokencode = pytoken.tok_punct.get( value, None )
     if tokencode is None:
-	if not py_name.match( value ):
-	    raise RuntimeError("Unknown STRING value ('%s')" % value )
-	# assume a keyword
-	tok = Token( pytoken.NAME, value )
-	if value not in self.keywords:
-	    self.keywords.append( value )
+        if not py_name.match( value ):
+            raise RuntimeError("Unknown STRING value ('%s')" % value )
+        # assume a keyword
+        tok = Token( pytoken.NAME, value )
+        if value not in self.keywords:
+            self.keywords.append( value )
     else:
-	# punctuation
-	tok = Token( tokencode )
+        # punctuation
+        tok = Token( tokencode )
     return tok
 
 def ebnf_handle_sequence_alt( self, node ):
@@ -169,9 +169,9 @@
 ebnf_handles = {}
 for name, value in globals().items():
     if name.startswith("ebnf_handle_"):
-	name = name[12:]
-	key = getattr(ebnfgrammar, name )
-	ebnf_handles[key] = value
+        name = name[12:]
+        key = getattr(ebnfgrammar, name )
+        ebnf_handles[key] = value
 
 def handle_unknown( self, node ):
     raise RuntimeError("Unknown Visitor for %r" % node.name)
@@ -200,8 +200,8 @@
         return itm
 
     def visit_syntaxnode( self, node ):
-	visit_func = ebnf_handles.get( node.name, handle_unknown )
-	return visit_func( self, node )
+        visit_func = ebnf_handles.get( node.name, handle_unknown )
+        return visit_func( self, node )
 
     def visit_tokennode( self, node ):
         return self.visit_syntaxnode( node )

Modified: pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py	Wed Aug  9 12:16:17 2006
@@ -28,8 +28,8 @@
             print "Type mismatch", repr(l), repr(r)
             print "l is str", repr(l), type(l)==str
             print "r is AssName", repr(r), isinstance(r,ast_ast.AssName)
-	    print "left is", repr(left)
-	    print "right is", repr(right)
+            print "left is", repr(left)
+            print "right is", repr(right)
             return False
     return True
 

Modified: pypy/dist/pypy/interpreter/test/test_objspace.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_objspace.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_objspace.py	Wed Aug  9 12:16:17 2006
@@ -134,14 +134,14 @@
 
     def test_interp_w(self):
         w = self.space.wrap
-	w_bltinfunction = self.space.builtin.get('len')
-	res = self.space.interp_w(Function, w_bltinfunction)
-	assert res is w_bltinfunction   # with the std objspace only
-	self.space.raises_w(self.space.w_TypeError, self.space.interp_w, PyCode, w_bltinfunction)
-	self.space.raises_w(self.space.w_TypeError, self.space.interp_w, Function, w(42))
-	self.space.raises_w(self.space.w_TypeError, self.space.interp_w, Function, w(None))
-	res = self.space.interp_w(Function, w(None), can_be_None=True)
-	assert res is None
+        w_bltinfunction = self.space.builtin.get('len')
+        res = self.space.interp_w(Function, w_bltinfunction)
+        assert res is w_bltinfunction   # with the std objspace only
+        self.space.raises_w(self.space.w_TypeError, self.space.interp_w, PyCode, w_bltinfunction)
+        self.space.raises_w(self.space.w_TypeError, self.space.interp_w, Function, w(42))
+        self.space.raises_w(self.space.w_TypeError, self.space.interp_w, Function, w(None))
+        res = self.space.interp_w(Function, w(None), can_be_None=True)
+        assert res is None
 
 class TestModuleMinimal: 
     def test_sys_exists(self):

Modified: pypy/dist/pypy/jit/codegen/i386/autotest.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/autotest.py	(original)
+++ pypy/dist/pypy/jit/codegen/i386/autotest.py	Wed Aug  9 12:16:17 2006
@@ -304,9 +304,9 @@
     items.sort()
     for key, value in items:
         if isinstance(value, i386.Instruction):
-	    if key in FORBIDDEN:
-	        print "Skipped", key
-	    else:
+            if key in FORBIDDEN:
+                print "Skipped", key
+            else:
                 complete_test(key,value)
     print "Ok."
 

Modified: pypy/dist/pypy/jit/timeshifter/rtyper.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/rtyper.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/rtyper.py	Wed Aug  9 12:16:17 2006
@@ -35,7 +35,7 @@
 class HintRTyper(RPythonTyper):
 
     def __init__(self, hannotator, timeshifter):
-    	RPythonTyper.__init__(self, hannotator, 
+        RPythonTyper.__init__(self, hannotator, 
                               type_system=HintTypeSystem.instance)
         self.green_reprs = PRECOMPUTED_GREEN_REPRS.copy()
         self.red_reprs = {}

Modified: pypy/dist/pypy/lib/pyontology/test/test_ontology.py
==============================================================================
--- pypy/dist/pypy/lib/pyontology/test/test_ontology.py	(original)
+++ pypy/dist/pypy/lib/pyontology/test/test_ontology.py	Wed Aug  9 12:16:17 2006
@@ -646,33 +646,33 @@
     a_cls = URIRef('a')
     O.type(a_cls, URIRef(namespaces['owl']+'#Class'))
 
-    assert isinstance(O.variables['a_'], ClassDomain)	
+    assert isinstance(O.variables['a_'], ClassDomain)   
     O.type(a_cls, URIRef(namespaces['owl']+'#Restriction'))
-    assert isinstance(O.variables['a_'], Restriction)	
+    assert isinstance(O.variables['a_'], Restriction)   
 
 def test_class_demotion():
     O = Ontology()
     a_cls = URIRef('a')
     O.type(a_cls, URIRef(namespaces['owl']+'#Restriction'))
     O.variables[O.make_var(None, a_cls)].property = "SomeProp"
-    assert isinstance(O.variables['a_'], Restriction)	
+    assert isinstance(O.variables['a_'], Restriction)   
 
     O.type(a_cls, URIRef(namespaces['owl']+'#Class'))
 
-    assert isinstance(O.variables['a_'], Restriction)	
+    assert isinstance(O.variables['a_'], Restriction)   
     assert O.variables[O.make_var(None, a_cls)].property == "SomeProp"
 
 def test_property_to_objectproperty():
     O = Ontology()
     a_cls = URIRef('a')
     O.type(a_cls, URIRef(namespaces['rdf']+'#Property'))
-    assert isinstance(O.variables['a_'], Property)	
+    assert isinstance(O.variables['a_'], Property)      
     O.type(a_cls, URIRef(namespaces['owl']+'#ObjectProperty'))
-    assert isinstance(O.variables['a_'], Property)	
+    assert isinstance(O.variables['a_'], Property)      
 
     O.type(a_cls, URIRef(namespaces['rdf']+'#Property'))
 
-    assert isinstance(O.variables['a_'], ObjectProperty)	
+    assert isinstance(O.variables['a_'], ObjectProperty)        
 
 def test_individual():
     # test comparison (unknown, equal, different)

Modified: pypy/dist/pypy/module/__builtin__/importing.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/importing.py	(original)
+++ pypy/dist/pypy/module/__builtin__/importing.py	Wed Aug  9 12:16:17 2006
@@ -544,9 +544,9 @@
     import sys
     meta_path = sys.meta_path
     for hook in meta_path:
-		loader = hook.find_module(fullname,  path)
-		if loader:
-			return loader
+                loader = hook.find_module(fullname,  path)
+                if loader:
+                        return loader
     if path != None and type(path) == str:
        pass
        # XXX Check for frozen modules ?

Modified: pypy/dist/pypy/module/_socket/interp_socket.py
==============================================================================
--- pypy/dist/pypy/module/_socket/interp_socket.py	(original)
+++ pypy/dist/pypy/module/_socket/interp_socket.py	Wed Aug  9 12:16:17 2006
@@ -133,7 +133,7 @@
     addr = res.contents.ai_addr
     _c.freeaddrinfo(res)
     return addr
-		
+                
 def w_makesockaddr(space, caddr, caddrlen, proto):
     if caddrlen == 0:
         # No address -- may be recvfrom() from known socket

Modified: pypy/dist/pypy/module/bz2/interp_bz2.py
==============================================================================
--- pypy/dist/pypy/module/bz2/interp_bz2.py	(original)
+++ pypy/dist/pypy/module/bz2/interp_bz2.py	Wed Aug  9 12:16:17 2006
@@ -1007,7 +1007,7 @@
     
     in_bufsize = len(data)
     # conforming to bz2 manual, this is large enough to fit compressed
-	# data in one shot. We will check it later anyway.
+        # data in one shot. We will check it later anyway.
     out_bufsize = in_bufsize + (in_bufsize / 100 + 1) + 600
     
     out_buf = create_string_buffer(out_bufsize)        

Modified: pypy/dist/pypy/module/recparser/pyparser.py
==============================================================================
--- pypy/dist/pypy/module/recparser/pyparser.py	(original)
+++ pypy/dist/pypy/module/recparser/pyparser.py	Wed Aug  9 12:16:17 2006
@@ -236,11 +236,11 @@
 GrammarElement.descr_grammarelement_get_children = descr_grammarelement_get_children
 
 GrammarElement.typedef = TypeDef( "GrammarElement",
-				  #__repr__ = interp2app(GrammarElement.descr_grammarelement_repr,
-				  #                      unwrap_spec=['self', ObjSpace] ),
-				  get_children = interp2app(GrammarElement.descr_grammarelement_get_children,
-							    unwrap_spec=['self', ObjSpace] ),
-				  )
+                                  #__repr__ = interp2app(GrammarElement.descr_grammarelement_repr,
+                                  #                      unwrap_spec=['self', ObjSpace] ),
+                                  get_children = interp2app(GrammarElement.descr_grammarelement_get_children,
+                                                            unwrap_spec=['self', ObjSpace] ),
+                                  )
 
 
 
@@ -262,7 +262,7 @@
 def descr_alternative_insert(self, space, idx, w_rule ):
     rule = space.interp_w(GrammarElement, w_rule)
     if idx<0 or idx>len(self.args):
-	raise OperationError( space.w_IndexError, space.wrap("Invalid index") )
+        raise OperationError( space.w_IndexError, space.wrap("Invalid index") )
     self.args.insert( idx, rule )
 
 Alternative.descr_alternative_append = descr_alternative_append
@@ -273,17 +273,17 @@
 
 
 Alternative.typedef = TypeDef("Alternative", GrammarElement.typedef,
-			      __getitem__ = interp2app( Alternative.descr_alternative___getitem__,
-							unwrap_spec=['self',ObjSpace,int]),
-			      __setitem__ = interp2app( Alternative.descr_alternative___setitem__,
-							unwrap_spec=['self',ObjSpace,int,W_Root]),
-			      __delitem__ = interp2app( Alternative.descr_alternative___delitem__,
-							unwrap_spec=['self',ObjSpace,int]),
-			      insert = interp2app( Alternative.descr_alternative_insert,
-						   unwrap_spec = ['self', ObjSpace, int, W_Root ] ),
-			      append = interp2app( Alternative.descr_alternative_append,
-						   unwrap_spec = ['self', ObjSpace, W_Root ] ),
-			      )
+                              __getitem__ = interp2app( Alternative.descr_alternative___getitem__,
+                                                        unwrap_spec=['self',ObjSpace,int]),
+                              __setitem__ = interp2app( Alternative.descr_alternative___setitem__,
+                                                        unwrap_spec=['self',ObjSpace,int,W_Root]),
+                              __delitem__ = interp2app( Alternative.descr_alternative___delitem__,
+                                                        unwrap_spec=['self',ObjSpace,int]),
+                              insert = interp2app( Alternative.descr_alternative_insert,
+                                                   unwrap_spec = ['self', ObjSpace, int, W_Root ] ),
+                              append = interp2app( Alternative.descr_alternative_append,
+                                                   unwrap_spec = ['self', ObjSpace, W_Root ] ),
+                              )
 
 Sequence.descr_alternative_append = descr_alternative_append
 Sequence.descr_alternative_insert = descr_alternative_insert
@@ -293,26 +293,26 @@
 
 
 Sequence.typedef = TypeDef("Sequence", GrammarElement.typedef,
-			      __getitem__ = interp2app( Sequence.descr_alternative___getitem__,
-							unwrap_spec=['self',ObjSpace,int]),
-			      __setitem__ = interp2app( Sequence.descr_alternative___setitem__,
-							unwrap_spec=['self',ObjSpace,int,W_Root]),
-			      __delitem__ = interp2app( Sequence.descr_alternative___delitem__,
-							unwrap_spec=['self',ObjSpace,int]),
-			      insert = interp2app( Sequence.descr_alternative_insert,
-						   unwrap_spec = ['self', ObjSpace, int, W_Root ] ),
-			      append = interp2app( Sequence.descr_alternative_append,
-						   unwrap_spec = ['self', ObjSpace, W_Root ] ),
-			      )
+                              __getitem__ = interp2app( Sequence.descr_alternative___getitem__,
+                                                        unwrap_spec=['self',ObjSpace,int]),
+                              __setitem__ = interp2app( Sequence.descr_alternative___setitem__,
+                                                        unwrap_spec=['self',ObjSpace,int,W_Root]),
+                              __delitem__ = interp2app( Sequence.descr_alternative___delitem__,
+                                                        unwrap_spec=['self',ObjSpace,int]),
+                              insert = interp2app( Sequence.descr_alternative_insert,
+                                                   unwrap_spec = ['self', ObjSpace, int, W_Root ] ),
+                              append = interp2app( Sequence.descr_alternative_append,
+                                                   unwrap_spec = ['self', ObjSpace, W_Root ] ),
+                              )
 
 def descr_kleenestar___getitem__(self, space, idx ):
     if idx!=0:
-	raise OperationError( space.w_ValueError, space.wrap("KleeneStar only support one child"))
+        raise OperationError( space.w_ValueError, space.wrap("KleeneStar only support one child"))
     return space.wrap(self.args[idx])
     
 def descr_kleenestar___setitem__(self, space, idx, w_rule ):
     if idx!=0:
-	raise OperationError( space.w_ValueError, space.wrap("KleeneStar only support one child"))
+        raise OperationError( space.w_ValueError, space.wrap("KleeneStar only support one child"))
     rule = space.interp_w(GrammarElement, w_rule)
     self.args[idx] = rule
 
@@ -320,10 +320,10 @@
 KleeneStar.descr_kleenestar___setitem__ = descr_kleenestar___setitem__
 
 KleeneStar.typedef = TypeDef("KleeneStar", GrammarElement.typedef,
-			     __getitem__ = interp2app(KleeneStar.descr_kleenestar___getitem__,
-						      unwrap_spec=[ 'self', ObjSpace, int]),
-			     __setitem__ = interp2app(KleeneStar.descr_kleenestar___setitem__,
-						      unwrap_spec=[ 'self', ObjSpace, int, W_Root ]),
-			     )
+                             __getitem__ = interp2app(KleeneStar.descr_kleenestar___getitem__,
+                                                      unwrap_spec=[ 'self', ObjSpace, int]),
+                             __setitem__ = interp2app(KleeneStar.descr_kleenestar___setitem__,
+                                                      unwrap_spec=[ 'self', ObjSpace, int, W_Root ]),
+                             )
 
 Token.typedef = TypeDef("Token", GrammarElement.typedef )

Modified: pypy/dist/pypy/module/recparser/test/test_compilehooks.py
==============================================================================
--- pypy/dist/pypy/module/recparser/test/test_compilehooks.py	(original)
+++ pypy/dist/pypy/module/recparser/test/test_compilehooks.py	Wed Aug  9 12:16:17 2006
@@ -49,7 +49,7 @@
         def change_globals(ast, enc):
             class ChangeGlobalsVisitor:
                 def visitConst(self, node):
-		    pass
+                    pass
 
                 def defaultvisit(self, node):
                     for child in node.getChildNodes():
@@ -66,7 +66,7 @@
         # install the hook
         import parser
         parser.install_compiler_hook(change_globals)
-	# check that the visitor changed all globals
-	# in the code into Consts
-	# TODO
-	# simplest version of the test : dis(code) | grep -v LOAD_GLOBAL == dis(code)
+        # check that the visitor changed all globals
+        # in the code into Consts
+        # TODO
+        # simplest version of the test : dis(code) | grep -v LOAD_GLOBAL == dis(code)

Modified: pypy/dist/pypy/objspace/cpy/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/cpy/objspace.py	(original)
+++ pypy/dist/pypy/objspace/cpy/objspace.py	Wed Aug  9 12:16:17 2006
@@ -96,11 +96,11 @@
 
     def interp_w(self, RequiredClass, w_obj, can_be_None=False):
         """
-	 Unwrap w_obj, checking that it is an instance of the required internal
-	 interpreter class (a subclass of Wrappable).
-	"""
-	if can_be_None and self.is_w(w_obj, self.w_None):
-	    return None
+         Unwrap w_obj, checking that it is an instance of the required internal
+         interpreter class (a subclass of Wrappable).
+        """
+        if can_be_None and self.is_w(w_obj, self.w_None):
+            return None
         from pypy.objspace.cpy.typedef import cpython2rpython
         return cpython2rpython(self, RequiredClass, w_obj)
     interp_w._annspecialcase_ = 'specialize:arg(1)'

Modified: pypy/dist/pypy/rpython/lltypesystem/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rclass.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rclass.py	Wed Aug  9 12:16:17 2006
@@ -526,7 +526,7 @@
         return vptr
 
     def rtype_type(self, hop):
-	if hop.s_result.is_constant():
+        if hop.s_result.is_constant():
             return hop.inputconst(hop.r_result, hop.s_result.const)
         instance_repr = self.common_repr()
         vinst, = hop.inputargs(instance_repr)

Modified: pypy/dist/pypy/rpython/numpy/aarray.py
==============================================================================
--- pypy/dist/pypy/rpython/numpy/aarray.py	(original)
+++ pypy/dist/pypy/rpython/numpy/aarray.py	Wed Aug  9 12:16:17 2006
@@ -27,8 +27,8 @@
     }
     def __init__(self, knowntype, typecode):
         self.knowntype = knowntype
-	self.typecode = typecode
-	self.rank = 1
+        self.typecode = typecode
+        self.rank = 1
 
     def can_be_none(self):
         return True
@@ -83,7 +83,7 @@
     _about_ = numpy.array
 
     def compute_result_annotation(self, arg_list, *args_s, **kwds_s):
-	if not isinstance(arg_list, SomeList):
+        if not isinstance(arg_list, SomeList):
             raise AnnotatorError("numpy.array expects SomeList")
 
         # First guess type from input list
@@ -93,7 +93,7 @@
 
         # now see if the dtype arg over-rides the typecode
         dtype = None
-	if len(args_s)>0:
+        if len(args_s)>0:
             dtype = args_s[0]
         if "dtype" in kwds_s:
             dtype = kwds_s["dtype"]

Modified: pypy/dist/pypy/rpython/ootypesystem/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rclass.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/rclass.py	Wed Aug  9 12:16:17 2006
@@ -407,7 +407,7 @@
         return ootype.oostring(instance, self.ll_const(-1))
 
     def rtype_type(self, hop):
-	if hop.s_result.is_constant():
+        if hop.s_result.is_constant():
             return hop.inputconst(hop.r_result, hop.s_result.const)
         vinst, = hop.inputargs(self)
         if hop.args_s[0].can_be_none():

Modified: pypy/dist/pypy/tool/pytest/genreportdata.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/genreportdata.py	(original)
+++ pypy/dist/pypy/tool/pytest/genreportdata.py	Wed Aug  9 12:16:17 2006
@@ -3,8 +3,8 @@
 import py
 import sys
 if sys.version_info[:2] != (2,3):
-	raise RuntimeError("Genreportdata.py needs Python 2.3")
-	
+        raise RuntimeError("Genreportdata.py needs Python 2.3")
+        
 mydir = py.magic.autopath().dirpath().realpath()
 from pypy.tool.pytest import htmlreport 
 from pypy.tool.pytest import confpath 

Modified: pypy/dist/pypy/translator/backendopt/merge_if_blocks.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/merge_if_blocks.py	(original)
+++ pypy/dist/pypy/translator/backendopt/merge_if_blocks.py	Wed Aug  9 12:16:17 2006
@@ -35,9 +35,9 @@
     default.prevblock = firstblock
     default.args = [get_new_arg(arg) for arg in default.args]
     for block, case in chain:
-    	link = block.exits[1]
+        link = block.exits[1]
         links.append(link)
-	link.exitcase = case
+        link.exitcase = case
         link.llexitcase = case.value
         link.prevblock = firstblock
         link.args = [get_new_arg(arg) for arg in link.args]

Modified: pypy/dist/pypy/translator/c/gc.py
==============================================================================
--- pypy/dist/pypy/translator/c/gc.py	(original)
+++ pypy/dist/pypy/translator/c/gc.py	Wed Aug  9 12:16:17 2006
@@ -106,7 +106,7 @@
     def OP_GC_CALL_RTTI_DESTRUCTOR(self, funcgen, op):
         args = [funcgen.expr(v) for v in op.args]
         line = '%s(%s);' % (args[0], ', '.join(args[1:]))
-        return line	
+        return line     
     
     def OP_GC_FREE(self, funcgen, op):
         args = [funcgen.expr(v) for v in op.args]

Modified: pypy/dist/pypy/translator/cli/database.py
==============================================================================
--- pypy/dist/pypy/translator/cli/database.py	(original)
+++ pypy/dist/pypy/translator/cli/database.py	Wed Aug  9 12:16:17 2006
@@ -40,7 +40,7 @@
 DEFINED_INT_SYMBOLICS = {'MALLOC_ZERO_FILLED':1}
 
 def isnan(v):
-	return v != v*1.0 or (v == 1.0 and v == 2.0)
+        return v != v*1.0 or (v == 1.0 and v == 2.0)
 
 def isinf(v):
     return v!=0 and (v == v*2)

Modified: pypy/dist/pypy/translator/goal/gcbench.py
==============================================================================
--- pypy/dist/pypy/translator/goal/gcbench.py	(original)
+++ pypy/dist/pypy/translator/goal/gcbench.py	Wed Aug  9 12:16:17 2006
@@ -3,46 +3,46 @@
 #  of Post Communications.
 #  It was modified by Hans Boehm of Silicon Graphics.
 # 
-#  	This is no substitute for real applications.  No actual application
-# 	is likely to behave in exactly this way.  However, this benchmark was
-# 	designed to be more representative of real applications than other
-# 	Java GC benchmarks of which we are aware.
-# 	It attempts to model those properties of allocation requests that
-# 	are important to current GC techniques.
-# 	It is designed to be used either to obtain a single overall performance
-# 	number, or to give a more detailed estimate of how collector
-# 	performance varies with object lifetimes.  It prints the time
-# 	required to allocate and collect balanced binary trees of various
-# 	sizes.  Smaller trees result in shorter object lifetimes.  Each cycle
-#	allocates roughly the same amount of memory.
-#	Two data structures are kept around during the entire process, so
-#	that the measured performance is representative of applications
-#	that maintain some live in-memory data.  One of these is a tree
-#	containing many pointers.  The other is a large array containing
-#	double precision floating point numbers.  Both should be of comparable
-#	size.
+#       This is no substitute for real applications.  No actual application
+#       is likely to behave in exactly this way.  However, this benchmark was
+#       designed to be more representative of real applications than other
+#       Java GC benchmarks of which we are aware.
+#       It attempts to model those properties of allocation requests that
+#       are important to current GC techniques.
+#       It is designed to be used either to obtain a single overall performance
+#       number, or to give a more detailed estimate of how collector
+#       performance varies with object lifetimes.  It prints the time
+#       required to allocate and collect balanced binary trees of various
+#       sizes.  Smaller trees result in shorter object lifetimes.  Each cycle
+#       allocates roughly the same amount of memory.
+#       Two data structures are kept around during the entire process, so
+#       that the measured performance is representative of applications
+#       that maintain some live in-memory data.  One of these is a tree
+#       containing many pointers.  The other is a large array containing
+#       double precision floating point numbers.  Both should be of comparable
+#       size.
 #
-#	The results are only really meaningful together with a specification
-#	of how much memory was used.  It is possible to trade memory for
-#	better time performance.  This benchmark should be run in a 32 MB
-#	heap, though we don't currently know how to enforce that uniformly.
+#       The results are only really meaningful together with a specification
+#       of how much memory was used.  It is possible to trade memory for
+#       better time performance.  This benchmark should be run in a 32 MB
+#       heap, though we don't currently know how to enforce that uniformly.
 #
-#	Unlike the original Ellis and Kovac benchmark, we do not attempt
-# 	measure pause times.  This facility should eventually be added back
-#	in.  There are several reasons for omitting it for now.  The original
-#	implementation depended on assumptions about the thread scheduler
-#	that don't hold uniformly.  The results really measure both the
-#	scheduler and GC.  Pause time measurements tend to not fit well with
-#	current benchmark suites.  As far as we know, none of the current
-#	commercial Java implementations seriously attempt to minimize GC pause
-#	times.
+#       Unlike the original Ellis and Kovac benchmark, we do not attempt
+#       measure pause times.  This facility should eventually be added back
+#       in.  There are several reasons for omitting it for now.  The original
+#       implementation depended on assumptions about the thread scheduler
+#       that don't hold uniformly.  The results really measure both the
+#       scheduler and GC.  Pause time measurements tend to not fit well with
+#       current benchmark suites.  As far as we know, none of the current
+#       commercial Java implementations seriously attempt to minimize GC pause
+#       times.
 #
-#	Known deficiencies:
-#		- No way to check on memory use
-#		- No cyclic data structures
-#		- No attempt to measure variation with object size
-#		- Results are sensitive to locking cost, but we dont
-#		  check for proper locking
+#       Known deficiencies:
+#               - No way to check on memory use
+#               - No cyclic data structures
+#               - No attempt to measure variation with object size
+#               - Results are sensitive to locking cost, but we dont
+#                 check for proper locking
 import os, time
 
 def println(s):

Modified: pypy/dist/pypy/translator/js/demo/jsdemo/servermessage.py
==============================================================================
--- pypy/dist/pypy/translator/js/demo/jsdemo/servermessage.py	(original)
+++ pypy/dist/pypy/translator/js/demo/jsdemo/servermessage.py	Wed Aug  9 12:16:17 2006
@@ -21,8 +21,8 @@
 
 
 #proxy messages
-#PMSG_PING          = "ping"	#server wants to hear from client
-#PMSG_PONG          = "pong"	#server responds to client's ping
+#PMSG_PING          = "ping"    #server wants to hear from client
+#PMSG_PONG          = "pong"    #server responds to client's ping
 PMSG_DEF_PLAYFIELD = "def_playfield"
 PMSG_DEF_ICON      = "def_icon"
 PMSG_PLAYER_ICON   = "player_icon"

Modified: pypy/dist/pypy/translator/microbench/pybench/pybench.py
==============================================================================
--- pypy/dist/pypy/translator/microbench/pybench/pybench.py	(original)
+++ pypy/dist/pypy/translator/microbench/pybench/pybench.py	Wed Aug  9 12:16:17 2006
@@ -409,7 +409,7 @@
         self.head.append(
             html.link(rel="Stylesheet", type="text/css", href="MochiKit-1.1/examples/sortable_tables/sortable_tables.css"))
         self.head.append(
-	            html.script(rel="JavaScript", type="text/javascript", src="MochiKit-1.1/lib/MochiKit/MochiKit.js"))
+                    html.script(rel="JavaScript", type="text/javascript", src="MochiKit-1.1/lib/MochiKit/MochiKit.js"))
         self.head.append(
             html.script(rel="JavaScript", type="text/javascript", src="MochiKit-1.1/examples/sortable_tables/sortable_tables.js"))
 



More information about the Pypy-commit mailing list