[Python-3000-checkins] r51599 - python/branches/p3yk/Modules/cgen.py

brett.cannon python-3000-checkins at python.org
Fri Aug 25 06:36:39 CEST 2006


Author: brett.cannon
Date: Fri Aug 25 06:36:39 2006
New Revision: 51599

Modified:
   python/branches/p3yk/Modules/cgen.py
Log:
Remove more '<>' usage.

``python -m compileall -f`` is really handy for finding Python files that use
invalid syntax.


Modified: python/branches/p3yk/Modules/cgen.py
==============================================================================
--- python/branches/p3yk/Modules/cgen.py	(original)
+++ python/branches/p3yk/Modules/cgen.py	Fri Aug 25 06:36:39 2006
@@ -167,9 +167,9 @@
             raise arg_error, ('\'*\' expected', sub)
     if sub == 'retval':
         # size is retval -- must be a reply argument
-        if mode <> 'r':
+        if mode != 'r':
             raise arg_error, ('non-r mode with [retval]', mode)
-    elif not isnum(sub) and (sub[:3] <> 'arg' or not isnum(sub[3:])):
+    elif not isnum(sub) and (sub[:3] != 'arg' or not isnum(sub[3:])):
         raise arg_error, ('bad subscript', sub)
     #
     return type, mode, num, sub
@@ -218,7 +218,7 @@
     #
     # Declare return value if any
     #
-    if type <> 'void':
+    if type != 'void':
         print '\t' + type, 'retval;'
     #
     # Declare arguments
@@ -283,7 +283,7 @@
             print '(!geti' + xtype + 'arraysize(args,',
             print repr(n_in_args) + ',',
             print repr(in_pos[j]) + ',',
-            if xtype <> a_type:
+            if xtype != a_type:
                 print '('+xtype+' *)',
             print '&arg' + repr(i+1) + '))'
             print '\t\treturn NULL;'
@@ -311,21 +311,21 @@
                 if a_factor and a_sub: print '*',
                 if a_sub: print a_sub,
                 print ',',
-                if (a_sub and a_factor) or xtype <> a_type:
+                if (a_sub and a_factor) or xtype != a_type:
                     print '('+xtype+' *)',
                 print 'arg' + repr(i+1) + '))'
             else: # Get a simple variable
                 print '(!geti' + xtype + 'arg(args,',
                 print repr(n_in_args) + ',',
                 print repr(in_pos[i]) + ',',
-                if xtype <> a_type:
+                if xtype != a_type:
                     print '('+xtype+' *)',
                 print '&arg' + repr(i+1) + '))'
             print '\t\treturn NULL;'
     #
     # Begin of function call
     #
-    if type <> 'void':
+    if type != 'void':
         print '\tretval =', func + '(',
     else:
         print '\t' + func + '(',
@@ -356,7 +356,7 @@
         #
         # Multiple return values -- construct a tuple
         #
-        if type <> 'void':
+        if type != 'void':
             n_out_args = n_out_args + 1
         if n_out_args == 1:
             for i in range(len(database)):
@@ -372,7 +372,7 @@
             print n_out_args, ');'
             print '\t  if (v == NULL) return NULL;'
             i_out = 0
-            if type <> 'void':
+            if type != 'void':
                 print '\t  PyTuple_SetItem(v,',
                 print repr(i_out) + ',',
                 print mkobject(type, 'retval') + ');'
@@ -489,7 +489,7 @@
     elif len(words) < 2:
         err('Line', lno, ': no funcname :', line)
     else:
-        if len(words) % 2 <> 0:
+        if len(words) % 2 != 0:
             err('Line', lno, ': odd argument list :', words[2:])
         else:
             database = []


More information about the Python-3000-checkins mailing list