[Python-3000-checkins] r59565 - in python/branches/py3k: Doc/whatsnew/2.6.rst Include/abstract.h Include/boolobject.h Include/bytesobject.h Include/cStringIO.h Include/cellobject.h Include/cobject.h Include/code.h Include/complexobject.h Include/datetime.h Include/descrobject.h Include/dictobject.h Include/floatobject.h Include/frameobject.h Include/funcobject.h Include/genobject.h Include/iterobject.h Include/listobject.h Include/longobject.h Include/memoryobject.h Include/methodobject.h Include/moduleobject.h Include/object.h Include/objimpl.h Include/py_curses.h Include/rangeobject.h Include/setobject.h Include/sliceobject.h Include/stringobject.h Include/symtable.h Include/traceback.h Include/tupleobject.h Include/unicodeobject.h Include/weakrefobject.h Mac/Modules/MacOS.c Mac/Modules/ae/_AEmodule.c Mac/Modules/app/_Appmodule.c Mac/Modules/carbonevt/_CarbonEvtmodule.c Mac/Modules/cf/_CFmodule.c Mac/Modules/cg/_CGmodule.c Mac/Modules/cm/_Cmmodule.c Mac/Modules/ctl/_Ctlmodule.c Mac/Modules/dlg/_Dlgmodule.c Mac/Modules/drag/_Dragmodule.c Mac/Modules/file/_Filemodule.c Mac/Modules/ibcarbon/_IBCarbon.c Mac/Modules/list/_Listmodule.c Mac/Modules/menu/_Menumodule.c Mac/Modules/mlte/_Mltemodule.c Mac/Modules/osa/_OSAmodule.c Mac/Modules/qd/_Qdmodule.c Mac/Modules/qdoffs/_Qdoffsmodule.c Mac/Modules/qt/_Qtmodule.c Mac/Modules/res/_Resmodule.c Mac/Modules/scrap/_Scrapmodule.c Mac/Modules/snd/_Sndmodule.c Mac/Modules/te/_TEmodule.c Mac/Modules/win/_Winmodule.c Modules/_bsddb.c Modules/_collectionsmodule.c Modules/_csv.c Modules/_ctypes/_ctypes.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/stgdict.c Modules/_curses_panel.c Modules/_cursesmodule.c Modules/_elementtree.c Modules/_fileio.c Modules/_functoolsmodule.c Modules/_hashopenssl.c Modules/_lsprof.c Modules/_randommodule.c Modules/_sqlite/cache.c Modules/_sqlite/connection.c Modules/_sqlite/cursor.c Modules/_sqlite/prepare_protocol.c Modules/_sqlite/row.c Modules/_sqlite/statement.c Modules/_sre.c Modules/_ssl.c Modules/_struct.c Modules/_testcapimodule.c Modules/_tkinter.c Modules/_weakref.c Modules/arraymodule.c Modules/bz2module.c Modules/cStringIO.c Modules/cjkcodecs/multibytecodec.c Modules/datetimemodule.c Modules/dbmmodule.c Modules/dlmodule.c Modules/gcmodule.c Modules/gdbmmodule.c Modules/itertoolsmodule.c Modules/mathmodule.c Modules/md5module.c Modules/mmapmodule.c Modules/parsermodule.c Modules/posixmodule.c Modules/pyexpat.c Modules/selectmodule.c Modules/sha1module.c Modules/sha256module.c Modules/sha512module.c Modules/socketmodule.c Modules/threadmodule.c Modules/timemodule.c Modules/unicodedata.c Modules/xxmodule.c Modules/zipimport.c Modules/zlibmodule.c Objects/abstract.c Objects/bytesobject.c Objects/classobject.c Objects/dictobject.c Objects/enumobject.c Objects/exceptions.c Objects/floatobject.c Objects/frameobject.c Objects/funcobject.c Objects/genobject.c Objects/iterobject.c Objects/listobject.c Objects/longobject.c Objects/moduleobject.c Objects/object.c Objects/setobject.c Objects/sliceobject.c Objects/stringlib/string_format.h Objects/stringobject.c Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c PC/_subprocess.c PC/_winreg.c Parser/tokenizer.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/codecs.c Python/marshal.c

christian.heimes python-3000-checkins at python.org
Wed Dec 19 03:45:51 CET 2007


Author: christian.heimes
Date: Wed Dec 19 03:45:37 2007
New Revision: 59565

Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Doc/whatsnew/2.6.rst
   python/branches/py3k/Include/abstract.h
   python/branches/py3k/Include/boolobject.h
   python/branches/py3k/Include/bytesobject.h
   python/branches/py3k/Include/cStringIO.h
   python/branches/py3k/Include/cellobject.h
   python/branches/py3k/Include/cobject.h
   python/branches/py3k/Include/code.h
   python/branches/py3k/Include/complexobject.h
   python/branches/py3k/Include/datetime.h
   python/branches/py3k/Include/descrobject.h
   python/branches/py3k/Include/dictobject.h
   python/branches/py3k/Include/floatobject.h
   python/branches/py3k/Include/frameobject.h
   python/branches/py3k/Include/funcobject.h
   python/branches/py3k/Include/genobject.h
   python/branches/py3k/Include/iterobject.h
   python/branches/py3k/Include/listobject.h
   python/branches/py3k/Include/longobject.h
   python/branches/py3k/Include/memoryobject.h
   python/branches/py3k/Include/methodobject.h
   python/branches/py3k/Include/moduleobject.h
   python/branches/py3k/Include/object.h
   python/branches/py3k/Include/objimpl.h
   python/branches/py3k/Include/py_curses.h
   python/branches/py3k/Include/rangeobject.h
   python/branches/py3k/Include/setobject.h
   python/branches/py3k/Include/sliceobject.h
   python/branches/py3k/Include/stringobject.h
   python/branches/py3k/Include/symtable.h
   python/branches/py3k/Include/traceback.h
   python/branches/py3k/Include/tupleobject.h
   python/branches/py3k/Include/unicodeobject.h
   python/branches/py3k/Include/weakrefobject.h
   python/branches/py3k/Mac/Modules/MacOS.c
   python/branches/py3k/Mac/Modules/ae/_AEmodule.c
   python/branches/py3k/Mac/Modules/app/_Appmodule.c
   python/branches/py3k/Mac/Modules/carbonevt/_CarbonEvtmodule.c
   python/branches/py3k/Mac/Modules/cf/_CFmodule.c
   python/branches/py3k/Mac/Modules/cg/_CGmodule.c
   python/branches/py3k/Mac/Modules/cm/_Cmmodule.c
   python/branches/py3k/Mac/Modules/ctl/_Ctlmodule.c
   python/branches/py3k/Mac/Modules/dlg/_Dlgmodule.c
   python/branches/py3k/Mac/Modules/drag/_Dragmodule.c
   python/branches/py3k/Mac/Modules/file/_Filemodule.c
   python/branches/py3k/Mac/Modules/ibcarbon/_IBCarbon.c
   python/branches/py3k/Mac/Modules/list/_Listmodule.c
   python/branches/py3k/Mac/Modules/menu/_Menumodule.c
   python/branches/py3k/Mac/Modules/mlte/_Mltemodule.c
   python/branches/py3k/Mac/Modules/osa/_OSAmodule.c
   python/branches/py3k/Mac/Modules/qd/_Qdmodule.c
   python/branches/py3k/Mac/Modules/qdoffs/_Qdoffsmodule.c
   python/branches/py3k/Mac/Modules/qt/_Qtmodule.c
   python/branches/py3k/Mac/Modules/res/_Resmodule.c
   python/branches/py3k/Mac/Modules/scrap/_Scrapmodule.c
   python/branches/py3k/Mac/Modules/snd/_Sndmodule.c
   python/branches/py3k/Mac/Modules/te/_TEmodule.c
   python/branches/py3k/Mac/Modules/win/_Winmodule.c
   python/branches/py3k/Modules/_bsddb.c
   python/branches/py3k/Modules/_collectionsmodule.c
   python/branches/py3k/Modules/_csv.c
   python/branches/py3k/Modules/_ctypes/_ctypes.c
   python/branches/py3k/Modules/_ctypes/callproc.c
   python/branches/py3k/Modules/_ctypes/cfield.c
   python/branches/py3k/Modules/_ctypes/stgdict.c
   python/branches/py3k/Modules/_curses_panel.c
   python/branches/py3k/Modules/_cursesmodule.c
   python/branches/py3k/Modules/_elementtree.c
   python/branches/py3k/Modules/_fileio.c
   python/branches/py3k/Modules/_functoolsmodule.c
   python/branches/py3k/Modules/_hashopenssl.c
   python/branches/py3k/Modules/_lsprof.c
   python/branches/py3k/Modules/_randommodule.c
   python/branches/py3k/Modules/_sqlite/cache.c
   python/branches/py3k/Modules/_sqlite/connection.c
   python/branches/py3k/Modules/_sqlite/cursor.c
   python/branches/py3k/Modules/_sqlite/prepare_protocol.c
   python/branches/py3k/Modules/_sqlite/row.c
   python/branches/py3k/Modules/_sqlite/statement.c
   python/branches/py3k/Modules/_sre.c
   python/branches/py3k/Modules/_ssl.c
   python/branches/py3k/Modules/_struct.c
   python/branches/py3k/Modules/_testcapimodule.c
   python/branches/py3k/Modules/_tkinter.c
   python/branches/py3k/Modules/_weakref.c
   python/branches/py3k/Modules/arraymodule.c
   python/branches/py3k/Modules/bz2module.c
   python/branches/py3k/Modules/cStringIO.c
   python/branches/py3k/Modules/cjkcodecs/multibytecodec.c
   python/branches/py3k/Modules/datetimemodule.c
   python/branches/py3k/Modules/dbmmodule.c
   python/branches/py3k/Modules/dlmodule.c
   python/branches/py3k/Modules/gcmodule.c
   python/branches/py3k/Modules/gdbmmodule.c
   python/branches/py3k/Modules/itertoolsmodule.c
   python/branches/py3k/Modules/mathmodule.c
   python/branches/py3k/Modules/md5module.c
   python/branches/py3k/Modules/mmapmodule.c
   python/branches/py3k/Modules/parsermodule.c
   python/branches/py3k/Modules/posixmodule.c
   python/branches/py3k/Modules/pyexpat.c
   python/branches/py3k/Modules/selectmodule.c
   python/branches/py3k/Modules/sha1module.c
   python/branches/py3k/Modules/sha256module.c
   python/branches/py3k/Modules/sha512module.c
   python/branches/py3k/Modules/socketmodule.c
   python/branches/py3k/Modules/threadmodule.c
   python/branches/py3k/Modules/timemodule.c
   python/branches/py3k/Modules/unicodedata.c
   python/branches/py3k/Modules/xxmodule.c
   python/branches/py3k/Modules/zipimport.c
   python/branches/py3k/Modules/zlibmodule.c
   python/branches/py3k/Objects/abstract.c
   python/branches/py3k/Objects/bytesobject.c
   python/branches/py3k/Objects/classobject.c
   python/branches/py3k/Objects/dictobject.c
   python/branches/py3k/Objects/enumobject.c
   python/branches/py3k/Objects/exceptions.c
   python/branches/py3k/Objects/floatobject.c
   python/branches/py3k/Objects/frameobject.c
   python/branches/py3k/Objects/funcobject.c
   python/branches/py3k/Objects/genobject.c
   python/branches/py3k/Objects/iterobject.c
   python/branches/py3k/Objects/listobject.c
   python/branches/py3k/Objects/longobject.c
   python/branches/py3k/Objects/moduleobject.c
   python/branches/py3k/Objects/object.c
   python/branches/py3k/Objects/setobject.c
   python/branches/py3k/Objects/sliceobject.c
   python/branches/py3k/Objects/stringlib/string_format.h
   python/branches/py3k/Objects/stringobject.c
   python/branches/py3k/Objects/structseq.c
   python/branches/py3k/Objects/tupleobject.c
   python/branches/py3k/Objects/typeobject.c
   python/branches/py3k/Objects/unicodeobject.c
   python/branches/py3k/Objects/weakrefobject.c
   python/branches/py3k/PC/_subprocess.c
   python/branches/py3k/PC/_winreg.c
   python/branches/py3k/Parser/tokenizer.c
   python/branches/py3k/Python/ast.c
   python/branches/py3k/Python/bltinmodule.c
   python/branches/py3k/Python/ceval.c
   python/branches/py3k/Python/codecs.c
   python/branches/py3k/Python/marshal.c
Log:
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.

Modified: python/branches/py3k/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/2.6.rst	(original)
+++ python/branches/py3k/Doc/whatsnew/2.6.rst	Wed Dec 19 03:45:37 2007
@@ -72,8 +72,6 @@
 Python 3.0
 ================
 
-.. % XXX add general comment about Python 3.0 features in 2.6
-
 The development cycle for Python 2.6 also saw the release of the first
 alphas of Python 3.0, and the development of 3.0 has influenced 
 a number of features in 2.6.
@@ -95,7 +93,9 @@
 A new command-line switch, :option:`-3`, enables warnings
 about features that will be removed in Python 3.0.  You can run code
 with this switch to see how much work will be necessary to port
-code to 3.0.
+code to 3.0.  The value of this switch is available 
+to Python code as the boolean variable ``sys.py3kwarning``,
+and to C extension code as :cdata:`Py_Py3kWarningFlag`.
 
 .. seealso::
 
@@ -103,6 +103,62 @@
    Python 3.0 and various features that have been accepted, rejected,
    or are still under consideration.
 
+
+Development Changes
+==================================================
+
+While 2.6 was being developed, the Python development process 
+underwent two significant changes: the developer group 
+switched from SourceForge's issue tracker to a customized 
+Roundup installation, and the documentation was converted from
+LaTeX to reStructured Text.
+
+
+New Issue Tracker: Roundup
+--------------------------------------------------
+
+XXX write this.
+
+
+New Documentation Format: ReStructured Text
+--------------------------------------------------
+
+Python's documentation had been written using LaTeX since the
+project's inception around 1989.  At that time, most documentation was
+printed out for later study, not viewed online. LaTeX was widely used
+because it provided attractive printed output while 
+remaining straightforward to write, once the basic rules 
+of the markup have been learned.
+
+LaTeX is still used today for writing technical publications destined
+for printing, but the landscape for programming tools has shifted.  We
+no longer print out reams of documentation; instead, we browse through
+it online and HTML is the most important format to support.
+Unfortunately, converting LaTeX to HTML is fairly complicated, and
+Fred L. Drake Jr., the Python documentation editor for many years,
+spent a lot of time wrestling the conversion process into shape.
+Occasionally people would suggest converting the documentation into 
+SGML or, later, XML, but performing a good conversion is a major task 
+and no one pursued the task to completion.
+
+During the 2.6 development cycle, Georg Brandl put a substantial 
+effort into building a new toolchain called Sphinx 
+for processing the documentation.
+The input format is reStructured Text, 
+a markup commonly used in the Python community that supports
+custom extensions  and directives.   Sphinx concentrates 
+on its HTML output, producing attractively styled 
+and modern HTML. (XXX finish this -- mention new search feature)
+
+.. seealso::
+
+   `Docutils <http://docutils.sf.net>`__: The fundamental
+   reStructured Text parser and toolset.
+
+   `Documenting Python <XXX>`__: Describes how to write for 
+   Python's documentation.
+
+
 PEP 343: The 'with' statement
 =============================
 
@@ -352,6 +408,24 @@
 
 .. % ======================================================================
 
+.. _pep-0366:
+
+PEP 366: Explicit Relative Imports From a Main Module
+============================================================
+
+Python's :option:`-m` switch allows running a module as a script.
+When you ran a module that was located inside a package, relative
+imports didn't work correctly.
+
+The fix in Python 2.6 adds a :attr:`__package__` attribute to modules.
+When present, relative imports will be relative to the value of this
+attribute instead of the :attr:`__name__` attribute.  PEP 302-style
+importers can then set :attr:`__package__`.  The :mod:`runpy` module
+that implements the :option:`-m` switch now does this, so relative imports
+can now be used in scripts running from inside a package.
+
+.. % ======================================================================
+
 .. _pep-3110:
 
 PEP 3110: Exception-Handling Changes
@@ -414,7 +488,7 @@
    :pep:`3119` - Introducing Abstract Base Classes
       PEP written by Guido van Rossum and Talin.
       Implemented by XXX.
-      Backported to 2.6 by Benjamin Aranguren (with Alex Martelli).
+      Backported to 2.6 by Benjamin Aranguren, with Alex Martelli.
 
 Other Language Changes
 ======================
@@ -443,6 +517,25 @@
 
   .. % Revision 57619
 
+* Properties now have two attributes, 
+  :attr:`setter` and :attr:`deleter`, that are useful shortcuts for
+  adding a setter or deleter function to an existing property.  
+  You would use them like this::
+
+    class C(object):
+	@property                                                              
+	def x(self): 
+	    return self._x                                            
+
+	@x.setter                                                              
+	def x(self, value): 
+	    self._x = value                                    
+
+	@x.deleter                                                             
+	def x(self): 
+	    del self._x             
+
+
 * C functions and methods that use 
   :cfunc:`PyComplex_AsCComplex` will now accept arguments that 
   have a :meth:`__complex__` method.  In particular, the functions in the 
@@ -452,11 +545,26 @@
 
   .. % Patch #1675423
 
+  A numerical nicety: when creating a complex number from two floats
+  on systems that support signed zeros (-0 and +0), the 
+  :func:`complex()` constructor will now preserve the sign 
+  of the zero.
+
+  .. % Patch 1507
+
 * Changes to the :class:`Exception` interface
   as dictated by :pep:`352` continue to be made.  For 2.6, 
   the :attr:`message` attribute is being deprecated in favor of the
   :attr:`args` attribute.
 
+* The :exc:`GeneratorExit` exception now subclasses 
+  :exc:`BaseException` instead of :exc:`Exception`.  This means 
+  that an exception handler that does ``except Exception:``
+  will not inadvertently catch :exc:`GeneratorExit`. 
+  (Contributed by Chad Austin.)
+
+  .. % Patch #1537
+
 * The :func:`compile` built-in function now accepts keyword arguments
   as well as positional parameters.  (Contributed by Thomas Wouters.)
 
@@ -653,6 +761,20 @@
 
   .. % Patch #1490190
 
+* The :mod:`new` module has been removed from Python 3.0.
+  Importing it therefore
+  triggers a warning message when Python is running in 3.0-warning
+  mode.
+
+* New functions in the :mod:`os` module include 
+  ``fchmod(fd, mode)``,   ``fchown(fd, uid, gid)``,  
+  and ``lchmod(path, mode)``, on operating systems that support these
+  functions. :func:`fchmod` and :func:`fchown` let you change the mode
+  and ownership of an opened file, and :func:`lchmod` changes the mode
+  of a symlink.
+
+  (Contributed by Georg Brandl and Christian Heimes.)
+
 * The :func:`os.walk` function now has a ``followlinks`` parameter. If
   set to True, it will follow symlinks pointing to directories and
   visit the directory's contents.  For backward compatibility, the
@@ -703,6 +825,15 @@
   changed and :const:`UF_APPEND` to indicate that data can only be appended to the
   file.  (Contributed by M. Levinson.)
 
+* The :mod:`random` module's :class:`Random` objects can
+  now be pickled on a 32-bit system and unpickled on a 64-bit
+  system, and vice versa.  Unfortunately, this change also means
+  that Python 2.6's :class:`Random` objects can't be unpickled correctly
+  on earlier versions of Python.
+  (Contributed by Shawn Ligocki.)
+
+  .. % Issue 1727780
+
 * The :mod:`rgbimg` module has been removed.
 
 * The :mod:`sets` module has been deprecated; it's better to 
@@ -725,6 +856,17 @@
 
   .. % Patch #957003
 
+* A new variable in the :mod:`sys` module,
+  :attr:`float_info`, is a dictionary 
+  containing information about the platform's floating-point support
+  derived from the :file:`float.h` file.  Key/value pairs 
+  in this dictionary include 
+  ``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"``
+  (smallest difference between 1.0 and the next largest value
+  representable), and several others.  (Contributed by Christian Heimes.)
+
+  .. % Patch 1534
+
 * The :mod:`tarfile` module now supports POSIX.1-2001 (pax) and
   POSIX.1-1988 (ustar) format tarfiles, in addition to the GNU tar
   format that was already supported.  The default format 
@@ -883,6 +1025,17 @@
 
   .. % Patch 1551895
 
+* Several functions return information about the platform's 
+  floating-point support.  :cfunc:`PyFloat_GetMax` returns
+  the maximum representable floating point value,
+  and :cfunc:`PyFloat_GetMin` returns the minimum 
+  positive value.  :cfunc:`PyFloat_GetInfo` returns a dictionary 
+  containing more information from the :file:`float.h` file, such as
+  ``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"``
+  (smallest difference between 1.0 and the next largest value
+  representable), and several others.
+
+  .. % Issue 1534
 
 .. % ======================================================================
 

Modified: python/branches/py3k/Include/abstract.h
==============================================================================
--- python/branches/py3k/Include/abstract.h	(original)
+++ python/branches/py3k/Include/abstract.h	Wed Dec 19 03:45:37 2007
@@ -1070,7 +1070,7 @@
        */
 
 #define PySequence_ITEM(o, i)\
-	( Py_Type(o)->tp_as_sequence->sq_item(o, i) )
+	( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
        /* Assume tp_as_sequence and sq_item exist and that i does not
 	  need to be corrected for a negative index
        */     

Modified: python/branches/py3k/Include/boolobject.h
==============================================================================
--- python/branches/py3k/Include/boolobject.h	(original)
+++ python/branches/py3k/Include/boolobject.h	Wed Dec 19 03:45:37 2007
@@ -9,7 +9,7 @@
 
 PyAPI_DATA(PyTypeObject) PyBool_Type;
 
-#define PyBool_Check(x) (Py_Type(x) == &PyBool_Type)
+#define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type)
 
 /* Py_False and Py_True are the only two bools in existence.
 Don't forget to apply Py_INCREF() when returning either!!! */

Modified: python/branches/py3k/Include/bytesobject.h
==============================================================================
--- python/branches/py3k/Include/bytesobject.h	(original)
+++ python/branches/py3k/Include/bytesobject.h	Wed Dec 19 03:45:37 2007
@@ -33,7 +33,7 @@
 
 /* Type check macros */
 #define PyBytes_Check(self) PyObject_TypeCheck(self, &PyBytes_Type)
-#define PyBytes_CheckExact(self) (Py_Type(self) == &PyBytes_Type)
+#define PyBytes_CheckExact(self) (Py_TYPE(self) == &PyBytes_Type)
 
 /* Direct API functions */
 PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
@@ -45,7 +45,7 @@
 
 /* Macros, trading safety for speed */
 #define PyBytes_AS_STRING(self) (assert(PyBytes_Check(self)),((PyBytesObject *)(self))->ob_bytes)
-#define PyBytes_GET_SIZE(self)  (assert(PyBytes_Check(self)),Py_Size(self))
+#define PyBytes_GET_SIZE(self)  (assert(PyBytes_Check(self)),Py_SIZE(self))
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k/Include/cStringIO.h
==============================================================================
--- python/branches/py3k/Include/cStringIO.h	(original)
+++ python/branches/py3k/Include/cStringIO.h	Wed Dec 19 03:45:37 2007
@@ -60,9 +60,9 @@
 
 /* These can be used to test if you have one */
 #define PycStringIO_InputCheck(O) \
-  (Py_Type(O)==PycStringIO->InputType)
+  (Py_TYPE(O)==PycStringIO->InputType)
 #define PycStringIO_OutputCheck(O) \
-  (Py_Type(O)==PycStringIO->OutputType)
+  (Py_TYPE(O)==PycStringIO->OutputType)
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k/Include/cellobject.h
==============================================================================
--- python/branches/py3k/Include/cellobject.h	(original)
+++ python/branches/py3k/Include/cellobject.h	Wed Dec 19 03:45:37 2007
@@ -13,7 +13,7 @@
 
 PyAPI_DATA(PyTypeObject) PyCell_Type;
 
-#define PyCell_Check(op) (Py_Type(op) == &PyCell_Type)
+#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)
 
 PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
 PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);

Modified: python/branches/py3k/Include/cobject.h
==============================================================================
--- python/branches/py3k/Include/cobject.h	(original)
+++ python/branches/py3k/Include/cobject.h	Wed Dec 19 03:45:37 2007
@@ -16,7 +16,7 @@
 
 PyAPI_DATA(PyTypeObject) PyCObject_Type;
 
-#define PyCObject_Check(op) (Py_Type(op) == &PyCObject_Type)
+#define PyCObject_Check(op) (Py_TYPE(op) == &PyCObject_Type)
 
 /* Create a PyCObject from a pointer to a C object and an optional
    destructor function.  If the second argument is non-null, then it

Modified: python/branches/py3k/Include/code.h
==============================================================================
--- python/branches/py3k/Include/code.h	(original)
+++ python/branches/py3k/Include/code.h	Wed Dec 19 03:45:37 2007
@@ -59,7 +59,7 @@
 
 PyAPI_DATA(PyTypeObject) PyCode_Type;
 
-#define PyCode_Check(op) (Py_Type(op) == &PyCode_Type)
+#define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type)
 #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
 
 /* Public interface */
@@ -72,7 +72,7 @@
 
 /* for internal use only */
 #define _PyCode_GETCODEPTR(co, pp) \
-	((*Py_Type((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
+	((*Py_TYPE((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
 	 ((co)->co_code, 0, (void **)(pp)))
 
 typedef struct _addr_pair {

Modified: python/branches/py3k/Include/complexobject.h
==============================================================================
--- python/branches/py3k/Include/complexobject.h	(original)
+++ python/branches/py3k/Include/complexobject.h	Wed Dec 19 03:45:37 2007
@@ -43,7 +43,7 @@
 PyAPI_DATA(PyTypeObject) PyComplex_Type;
 
 #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
-#define PyComplex_CheckExact(op) (Py_Type(op) == &PyComplex_Type)
+#define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type)
 
 PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
 PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);

Modified: python/branches/py3k/Include/datetime.h
==============================================================================
--- python/branches/py3k/Include/datetime.h	(original)
+++ python/branches/py3k/Include/datetime.h	Wed Dec 19 03:45:37 2007
@@ -166,19 +166,19 @@
 
 /* Macros for type checking when building the Python core. */
 #define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType)
-#define PyDate_CheckExact(op) (Py_Type(op) == &PyDateTime_DateType)
+#define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType)
 
 #define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType)
-#define PyDateTime_CheckExact(op) (Py_Type(op) == &PyDateTime_DateTimeType)
+#define PyDateTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateTimeType)
 
 #define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType)
-#define PyTime_CheckExact(op) (Py_Type(op) == &PyDateTime_TimeType)
+#define PyTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TimeType)
 
 #define PyDelta_Check(op) PyObject_TypeCheck(op, &PyDateTime_DeltaType)
-#define PyDelta_CheckExact(op) (Py_Type(op) == &PyDateTime_DeltaType)
+#define PyDelta_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DeltaType)
 
 #define PyTZInfo_Check(op) PyObject_TypeCheck(op, &PyDateTime_TZInfoType)
-#define PyTZInfo_CheckExact(op) (Py_Type(op) == &PyDateTime_TZInfoType)
+#define PyTZInfo_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TZInfoType)
 
 #else
 
@@ -198,19 +198,19 @@
 
 /* Macros for type checking when not building the Python core. */
 #define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType)
-#define PyDate_CheckExact(op) (Py_Type(op) == PyDateTimeAPI->DateType)
+#define PyDate_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateType)
 
 #define PyDateTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType)
-#define PyDateTime_CheckExact(op) (Py_Type(op) == PyDateTimeAPI->DateTimeType)
+#define PyDateTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateTimeType)
 
 #define PyTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType)
-#define PyTime_CheckExact(op) (Py_Type(op) == PyDateTimeAPI->TimeType)
+#define PyTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TimeType)
 
 #define PyDelta_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType)
-#define PyDelta_CheckExact(op) (Py_Type(op) == PyDateTimeAPI->DeltaType)
+#define PyDelta_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DeltaType)
 
 #define PyTZInfo_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType)
-#define PyTZInfo_CheckExact(op) (Py_Type(op) == PyDateTimeAPI->TZInfoType)
+#define PyTZInfo_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TZInfoType)
 
 /* Macros for accessing constructors in a simplified fashion. */
 #define PyDate_FromDate(year, month, day) \

Modified: python/branches/py3k/Include/descrobject.h
==============================================================================
--- python/branches/py3k/Include/descrobject.h	(original)
+++ python/branches/py3k/Include/descrobject.h	Wed Dec 19 03:45:37 2007
@@ -82,7 +82,7 @@
 					       struct PyGetSetDef *);
 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
 						struct wrapperbase *, void *);
-#define PyDescr_IsData(d) (Py_Type(d)->tp_descr_set != NULL)
+#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
 
 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);

Modified: python/branches/py3k/Include/dictobject.h
==============================================================================
--- python/branches/py3k/Include/dictobject.h	(original)
+++ python/branches/py3k/Include/dictobject.h	Wed Dec 19 03:45:37 2007
@@ -97,11 +97,11 @@
 PyAPI_DATA(PyTypeObject) PyDictValues_Type;
 
 #define PyDict_Check(op) \
-                 PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_DICT_SUBCLASS)
-#define PyDict_CheckExact(op) (Py_Type(op) == &PyDict_Type)
-#define PyDictKeys_Check(op) (Py_Type(op) == &PyDictKeys_Type)
-#define PyDictItems_Check(op) (Py_Type(op) == &PyDictItems_Type)
-#define PyDictValues_Check(op) (Py_Type(op) == &PyDictValues_Type)
+                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
+#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+#define PyDictKeys_Check(op) (Py_TYPE(op) == &PyDictKeys_Type)
+#define PyDictItems_Check(op) (Py_TYPE(op) == &PyDictItems_Type)
+#define PyDictValues_Check(op) (Py_TYPE(op) == &PyDictValues_Type)
 /* This excludes Values, since they are not sets. */
 # define PyDictViewSet_Check(op) \
 	(PyDictKeys_Check(op) || PyDictItems_Check(op))

Modified: python/branches/py3k/Include/floatobject.h
==============================================================================
--- python/branches/py3k/Include/floatobject.h	(original)
+++ python/branches/py3k/Include/floatobject.h	Wed Dec 19 03:45:37 2007
@@ -19,7 +19,7 @@
 PyAPI_DATA(PyTypeObject) PyFloat_Type;
 
 #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
-#define PyFloat_CheckExact(op) (Py_Type(op) == &PyFloat_Type)
+#define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type)
 
 PyAPI_FUNC(double) PyFloat_GetMax(void);
 PyAPI_FUNC(double) PyFloat_GetMin(void);

Modified: python/branches/py3k/Include/frameobject.h
==============================================================================
--- python/branches/py3k/Include/frameobject.h	(original)
+++ python/branches/py3k/Include/frameobject.h	Wed Dec 19 03:45:37 2007
@@ -51,7 +51,7 @@
 
 PyAPI_DATA(PyTypeObject) PyFrame_Type;
 
-#define PyFrame_Check(op) (Py_Type(op) == &PyFrame_Type)
+#define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type)
 
 PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
                                        PyObject *, PyObject *);

Modified: python/branches/py3k/Include/funcobject.h
==============================================================================
--- python/branches/py3k/Include/funcobject.h	(original)
+++ python/branches/py3k/Include/funcobject.h	Wed Dec 19 03:45:37 2007
@@ -41,7 +41,7 @@
 
 PyAPI_DATA(PyTypeObject) PyFunction_Type;
 
-#define PyFunction_Check(op) (Py_Type(op) == &PyFunction_Type)
+#define PyFunction_Check(op) (Py_TYPE(op) == &PyFunction_Type)
 
 PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *);

Modified: python/branches/py3k/Include/genobject.h
==============================================================================
--- python/branches/py3k/Include/genobject.h	(original)
+++ python/branches/py3k/Include/genobject.h	Wed Dec 19 03:45:37 2007
@@ -26,7 +26,7 @@
 PyAPI_DATA(PyTypeObject) PyGen_Type;
 
 #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
-#define PyGen_CheckExact(op) (Py_Type(op) == &PyGen_Type)
+#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
 
 PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
 PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);

Modified: python/branches/py3k/Include/iterobject.h
==============================================================================
--- python/branches/py3k/Include/iterobject.h	(original)
+++ python/branches/py3k/Include/iterobject.h	Wed Dec 19 03:45:37 2007
@@ -10,12 +10,12 @@
 PyAPI_DATA(PyTypeObject) PyZipIter_Type;
 PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type;
 
-#define PySeqIter_Check(op) (Py_Type(op) == &PySeqIter_Type)
+#define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type)
 
 PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
 
 
-#define PyCallIter_Check(op) (Py_Type(op) == &PyCallIter_Type)
+#define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type)
 
 PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
 

Modified: python/branches/py3k/Include/listobject.h
==============================================================================
--- python/branches/py3k/Include/listobject.h	(original)
+++ python/branches/py3k/Include/listobject.h	Wed Dec 19 03:45:37 2007
@@ -44,8 +44,8 @@
 PyAPI_DATA(PyTypeObject) PySortWrapper_Type;
 
 #define PyList_Check(op) \
-		PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_LIST_SUBCLASS)
-#define PyList_CheckExact(op) (Py_Type(op) == &PyList_Type)
+		PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
+#define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type)
 
 PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
 PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
@@ -63,7 +63,7 @@
 /* Macro, trading safety for speed */
 #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
 #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
-#define PyList_GET_SIZE(op)    Py_Size(op)
+#define PyList_GET_SIZE(op)    Py_SIZE(op)
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k/Include/longobject.h
==============================================================================
--- python/branches/py3k/Include/longobject.h	(original)
+++ python/branches/py3k/Include/longobject.h	Wed Dec 19 03:45:37 2007
@@ -12,8 +12,8 @@
 PyAPI_DATA(PyTypeObject) PyLong_Type;
 
 #define PyLong_Check(op) \
-		PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_LONG_SUBCLASS)
-#define PyLong_CheckExact(op) (Py_Type(op) == &PyLong_Type)
+		PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
+#define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type)
 
 PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
 PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);

Modified: python/branches/py3k/Include/memoryobject.h
==============================================================================
--- python/branches/py3k/Include/memoryobject.h	(original)
+++ python/branches/py3k/Include/memoryobject.h	Wed Dec 19 03:45:37 2007
@@ -16,7 +16,7 @@
 
 PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
 
-#define PyMemory_Check(op) (Py_Type(op) == &PyMemoryView_Type)
+#define PyMemory_Check(op) (Py_TYPE(op) == &PyMemoryView_Type)
 #define PyMemoryView(op) (((PyMemoryViewObject *)(op))->view)
 
 #define Py_END_OF_MEMORY	(-1)

Modified: python/branches/py3k/Include/methodobject.h
==============================================================================
--- python/branches/py3k/Include/methodobject.h	(original)
+++ python/branches/py3k/Include/methodobject.h	Wed Dec 19 03:45:37 2007
@@ -13,7 +13,7 @@
 
 PyAPI_DATA(PyTypeObject) PyCFunction_Type;
 
-#define PyCFunction_Check(op) (Py_Type(op) == &PyCFunction_Type)
+#define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type)
 
 typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
 typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,

Modified: python/branches/py3k/Include/moduleobject.h
==============================================================================
--- python/branches/py3k/Include/moduleobject.h	(original)
+++ python/branches/py3k/Include/moduleobject.h	Wed Dec 19 03:45:37 2007
@@ -10,7 +10,7 @@
 PyAPI_DATA(PyTypeObject) PyModule_Type;
 
 #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type)
-#define PyModule_CheckExact(op) (Py_Type(op) == &PyModule_Type)
+#define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type)
 
 PyAPI_FUNC(PyObject *) PyModule_New(const char *);
 PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);

Modified: python/branches/py3k/Include/object.h
==============================================================================
--- python/branches/py3k/Include/object.h	(original)
+++ python/branches/py3k/Include/object.h	Wed Dec 19 03:45:37 2007
@@ -109,9 +109,9 @@
 	Py_ssize_t ob_size; /* Number of items in variable part */
 } PyVarObject;
 
-#define Py_Refcnt(ob)		(((PyObject*)(ob))->ob_refcnt)
-#define Py_Type(ob)		(((PyObject*)(ob))->ob_type)
-#define Py_Size(ob)		(((PyVarObject*)(ob))->ob_size)
+#define Py_REFCNT(ob)		(((PyObject*)(ob))->ob_refcnt)
+#define Py_TYPE(ob)		(((PyObject*)(ob))->ob_type)
+#define Py_SIZE(ob)		(((PyVarObject*)(ob))->ob_size)
 
 /*
 Type objects contain a string containing the type name (to help somewhat
@@ -404,21 +404,21 @@
 
 /* access macro to the members which are floating "behind" the object */
 #define PyHeapType_GET_MEMBERS(etype) \
-    ((PyMemberDef *)(((char *)etype) + Py_Type(etype)->tp_basicsize))
+    ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))
 
 
 /* Generic type check */
 PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
 #define PyObject_TypeCheck(ob, tp) \
-	(Py_Type(ob) == (tp) || PyType_IsSubtype(Py_Type(ob), (tp)))
+	(Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))
 
 PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */
 PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */
 PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */
 
 #define PyType_Check(op) \
-	PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_TYPE_SUBCLASS)
-#define PyType_CheckExact(op) (Py_Type(op) == &PyType_Type)
+	PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS)
+#define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type)
 
 PyAPI_FUNC(int) PyType_Ready(PyTypeObject *);
 PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
@@ -612,9 +612,9 @@
 #ifdef COUNT_ALLOCS
 PyAPI_FUNC(void) inc_count(PyTypeObject *);
 PyAPI_FUNC(void) dec_count(PyTypeObject *);
-#define _Py_INC_TPALLOCS(OP)	inc_count(Py_Type(OP))
-#define _Py_INC_TPFREES(OP)	dec_count(Py_Type(OP))
-#define _Py_DEC_TPFREES(OP)	Py_Type(OP)->tp_frees--
+#define _Py_INC_TPALLOCS(OP)	inc_count(Py_TYPE(OP))
+#define _Py_INC_TPFREES(OP)	dec_count(Py_TYPE(OP))
+#define _Py_DEC_TPFREES(OP)	Py_TYPE(OP)->tp_frees--
 #define _Py_COUNT_ALLOCS_COMMA	,
 #else
 #define _Py_INC_TPALLOCS(OP)
@@ -639,13 +639,13 @@
 #define _Py_NewReference(op) (				\
 	_Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA	\
 	_Py_INC_REFTOTAL  _Py_REF_DEBUG_COMMA		\
-	Py_Refcnt(op) = 1)
+	Py_REFCNT(op) = 1)
 
 #define _Py_ForgetReference(op) _Py_INC_TPFREES(op)
 
 #define _Py_Dealloc(op) (				\
 	_Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA	\
-	(*Py_Type(op)->tp_dealloc)((PyObject *)(op)))
+	(*Py_TYPE(op)->tp_dealloc)((PyObject *)(op)))
 #endif /* !Py_TRACE_REFS */
 
 #define Py_INCREF(op) (				\

Modified: python/branches/py3k/Include/objimpl.h
==============================================================================
--- python/branches/py3k/Include/objimpl.h	(original)
+++ python/branches/py3k/Include/objimpl.h	Wed Dec 19 03:45:37 2007
@@ -151,9 +151,9 @@
 /* Macros trading binary compatibility for speed. See also pymem.h.
    Note that these macros expect non-NULL object pointers.*/
 #define PyObject_INIT(op, typeobj) \
-	( Py_Type(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
+	( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
 #define PyObject_INIT_VAR(op, typeobj, size) \
-	( Py_Size(op) = (size), PyObject_INIT((op), (typeobj)) )
+	( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) )
 
 #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize )
 
@@ -228,8 +228,8 @@
 #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
 
 /* Test if an object has a GC head */
-#define PyObject_IS_GC(o) (PyType_IS_GC(Py_Type(o)) && \
-	(Py_Type(o)->tp_is_gc == NULL || Py_Type(o)->tp_is_gc(o)))
+#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
+	(Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
 
 PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
 #define PyObject_GC_Resize(type, op, n) \
@@ -323,7 +323,7 @@
 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
 
 #define PyObject_GET_WEAKREFS_LISTPTR(o) \
-	((PyObject **) (((char *) (o)) + Py_Type(o)->tp_weaklistoffset))
+	((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k/Include/py_curses.h
==============================================================================
--- python/branches/py3k/Include/py_curses.h	(original)
+++ python/branches/py3k/Include/py_curses.h	Wed Dec 19 03:45:37 2007
@@ -73,7 +73,7 @@
 	WINDOW *win;
 } PyCursesWindowObject;
 
-#define PyCursesWindow_Check(v)	 (Py_Type(v) == &PyCursesWindow_Type)
+#define PyCursesWindow_Check(v)	 (Py_TYPE(v) == &PyCursesWindow_Type)
 
 #ifdef CURSES_MODULE
 /* This section is used when compiling _cursesmodule.c */

Modified: python/branches/py3k/Include/rangeobject.h
==============================================================================
--- python/branches/py3k/Include/rangeobject.h	(original)
+++ python/branches/py3k/Include/rangeobject.h	Wed Dec 19 03:45:37 2007
@@ -19,7 +19,7 @@
 PyAPI_DATA(PyTypeObject) PyRangeIter_Type;
 PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type;
 
-#define PyRange_Check(op) (Py_Type(op) == &PyRange_Type)
+#define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type)
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k/Include/setobject.h
==============================================================================
--- python/branches/py3k/Include/setobject.h	(original)
+++ python/branches/py3k/Include/setobject.h	Wed Dec 19 03:45:37 2007
@@ -67,13 +67,13 @@
  *     hash is -1
  */
 
-#define PyFrozenSet_CheckExact(ob) (Py_Type(ob) == &PyFrozenSet_Type)
+#define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type)
 #define PyAnySet_CheckExact(ob) \
-	(Py_Type(ob) == &PySet_Type || Py_Type(ob) == &PyFrozenSet_Type)
+	(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type)
 #define PyAnySet_Check(ob) \
-	(Py_Type(ob) == &PySet_Type || Py_Type(ob) == &PyFrozenSet_Type || \
-	  PyType_IsSubtype(Py_Type(ob), &PySet_Type) || \
-	  PyType_IsSubtype(Py_Type(ob), &PyFrozenSet_Type))
+	(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \
+	  PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
+	  PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
 
 PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
 PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);

Modified: python/branches/py3k/Include/sliceobject.h
==============================================================================
--- python/branches/py3k/Include/sliceobject.h	(original)
+++ python/branches/py3k/Include/sliceobject.h	Wed Dec 19 03:45:37 2007
@@ -26,7 +26,7 @@
 
 PyAPI_DATA(PyTypeObject) PySlice_Type;
 
-#define PySlice_Check(op) (Py_Type(op) == &PySlice_Type)
+#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
 
 PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
                                   PyObject* step);

Modified: python/branches/py3k/Include/stringobject.h
==============================================================================
--- python/branches/py3k/Include/stringobject.h	(original)
+++ python/branches/py3k/Include/stringobject.h	Wed Dec 19 03:45:37 2007
@@ -43,8 +43,8 @@
 PyAPI_DATA(PyTypeObject) PyStringIter_Type;
 
 #define PyString_Check(op) \
-                 PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_STRING_SUBCLASS)
-#define PyString_CheckExact(op) (Py_Type(op) == &PyString_Type)
+                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_STRING_SUBCLASS)
+#define PyString_CheckExact(op) (Py_TYPE(op) == &PyString_Type)
 
 PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, Py_ssize_t);
 PyAPI_FUNC(PyObject *) PyString_FromString(const char *);
@@ -68,7 +68,7 @@
 /* Macro, trading safety for speed */
 #define PyString_AS_STRING(op) (assert(PyString_Check(op)), \
                                 (((PyStringObject *)(op))->ob_sval))
-#define PyString_GET_SIZE(op)  (assert(PyString_Check(op)),Py_Size(op))
+#define PyString_GET_SIZE(op)  (assert(PyString_Check(op)),Py_SIZE(op))
 
 /* _PyString_Join(sep, x) is like sep.join(x).  sep must be PyStringObject*,
    x must be an iterable object. */

Modified: python/branches/py3k/Include/symtable.h
==============================================================================
--- python/branches/py3k/Include/symtable.h	(original)
+++ python/branches/py3k/Include/symtable.h	Wed Dec 19 03:45:37 2007
@@ -53,7 +53,7 @@
 
 PyAPI_DATA(PyTypeObject) PySTEntry_Type;
 
-#define PySTEntry_Check(op) (Py_Type(op) == &PySTEntry_Type)
+#define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type)
 
 PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);
 

Modified: python/branches/py3k/Include/traceback.h
==============================================================================
--- python/branches/py3k/Include/traceback.h	(original)
+++ python/branches/py3k/Include/traceback.h	Wed Dec 19 03:45:37 2007
@@ -22,7 +22,7 @@
 
 /* Reveal traceback type so we can typecheck traceback objects */
 PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
-#define PyTraceBack_Check(v) (Py_Type(v) == &PyTraceBack_Type)
+#define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type)
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k/Include/tupleobject.h
==============================================================================
--- python/branches/py3k/Include/tupleobject.h	(original)
+++ python/branches/py3k/Include/tupleobject.h	Wed Dec 19 03:45:37 2007
@@ -35,8 +35,8 @@
 PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
 
 #define PyTuple_Check(op) \
-                 PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_TUPLE_SUBCLASS)
-#define PyTuple_CheckExact(op) (Py_Type(op) == &PyTuple_Type)
+                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
+#define PyTuple_CheckExact(op) (Py_TYPE(op) == &PyTuple_Type)
 
 PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size);
 PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *);
@@ -48,7 +48,7 @@
 
 /* Macro, trading safety for speed */
 #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
-#define PyTuple_GET_SIZE(op)    Py_Size(op)
+#define PyTuple_GET_SIZE(op)    Py_SIZE(op)
 
 /* Macro, *only* to be used to fill in brand new tuples */
 #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)

Modified: python/branches/py3k/Include/unicodeobject.h
==============================================================================
--- python/branches/py3k/Include/unicodeobject.h	(original)
+++ python/branches/py3k/Include/unicodeobject.h	Wed Dec 19 03:45:37 2007
@@ -424,8 +424,8 @@
 #define SSTATE_INTERNED_IMMORTAL 2
 
 #define PyUnicode_Check(op) \
-                 PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_UNICODE_SUBCLASS)
-#define PyUnicode_CheckExact(op) (Py_Type(op) == &PyUnicode_Type)
+                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
+#define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type)
 
 /* Fast access macros */
 #define PyUnicode_GET_SIZE(op) \

Modified: python/branches/py3k/Include/weakrefobject.h
==============================================================================
--- python/branches/py3k/Include/weakrefobject.h	(original)
+++ python/branches/py3k/Include/weakrefobject.h	Wed Dec 19 03:45:37 2007
@@ -44,10 +44,10 @@
 
 #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType)
 #define PyWeakref_CheckRefExact(op) \
-        (Py_Type(op) == &_PyWeakref_RefType)
+        (Py_TYPE(op) == &_PyWeakref_RefType)
 #define PyWeakref_CheckProxy(op) \
-        ((Py_Type(op) == &_PyWeakref_ProxyType) || \
-         (Py_Type(op) == &_PyWeakref_CallableProxyType))
+        ((Py_TYPE(op) == &_PyWeakref_ProxyType) || \
+         (Py_TYPE(op) == &_PyWeakref_CallableProxyType))
 
 /* This macro calls PyWeakref_CheckRef() last since that can involve a
    function call; this makes it more likely that the function call

Modified: python/branches/py3k/Mac/Modules/MacOS.c
==============================================================================
--- python/branches/py3k/Mac/Modules/MacOS.c	(original)
+++ python/branches/py3k/Mac/Modules/MacOS.c	Wed Dec 19 03:45:37 2007
@@ -609,7 +609,7 @@
 	MacOS_Error = PyMac_GetOSErrException();
 	if (MacOS_Error == NULL || PyDict_SetItemString(d, "Error", MacOS_Error) != 0)
 		return;
-	Py_Type(&Rftype) = &PyType_Type;
+	Py_TYPE(&Rftype) = &PyType_Type;
 	Py_INCREF(&Rftype);
 	if (PyDict_SetItemString(d, "ResourceForkType", (PyObject *)&Rftype) != 0)
 		return;

Modified: python/branches/py3k/Mac/Modules/ae/_AEmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/ae/_AEmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/ae/_AEmodule.c	Wed Dec 19 03:45:37 2007
@@ -47,7 +47,7 @@
 
 PyTypeObject AEDesc_Type;
 
-#define AEDesc_Check(x) (Py_Type(x) == &AEDesc_Type || PyObject_TypeCheck((x), &AEDesc_Type))
+#define AEDesc_Check(x) (Py_TYPE(x) == &AEDesc_Type || PyObject_TypeCheck((x), &AEDesc_Type))
 
 typedef struct AEDescObject {
 	PyObject_HEAD
@@ -79,7 +79,7 @@
 static void AEDesc_dealloc(AEDescObject *self)
 {
 	if (self->ob_owned) AEDisposeDesc(&self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *AEDesc_AECoerceDesc(AEDescObject *_self, PyObject *_args)
@@ -1440,7 +1440,7 @@
 	if (AE_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", AE_Error) != 0)
 		return;
-	Py_Type(&AEDesc_Type) = &PyType_Type;
+	Py_TYPE(&AEDesc_Type) = &PyType_Type;
 	if (PyType_Ready(&AEDesc_Type) < 0) return;
 	Py_INCREF(&AEDesc_Type);
 	PyModule_AddObject(m, "AEDesc", (PyObject *)&AEDesc_Type);

Modified: python/branches/py3k/Mac/Modules/app/_Appmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/app/_Appmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/app/_Appmodule.c	Wed Dec 19 03:45:37 2007
@@ -30,7 +30,7 @@
 
 PyTypeObject ThemeDrawingState_Type;
 
-#define ThemeDrawingStateObj_Check(x) (Py_Type(x) == &ThemeDrawingState_Type || PyObject_TypeCheck((x), &ThemeDrawingState_Type))
+#define ThemeDrawingStateObj_Check(x) (Py_TYPE(x) == &ThemeDrawingState_Type || PyObject_TypeCheck((x), &ThemeDrawingState_Type))
 
 typedef struct ThemeDrawingStateObject {
 	PyObject_HEAD
@@ -60,7 +60,7 @@
 static void ThemeDrawingStateObj_dealloc(ThemeDrawingStateObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
@@ -1807,7 +1807,7 @@
 	if (App_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", App_Error) != 0)
 		return;
-	Py_Type(&ThemeDrawingState_Type) = &PyType_Type;
+	Py_TYPE(&ThemeDrawingState_Type) = &PyType_Type;
 	if (PyType_Ready(&ThemeDrawingState_Type) < 0) return;
 	Py_INCREF(&ThemeDrawingState_Type);
 	PyModule_AddObject(m, "ThemeDrawingState", (PyObject *)&ThemeDrawingState_Type);

Modified: python/branches/py3k/Mac/Modules/carbonevt/_CarbonEvtmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/carbonevt/_CarbonEvtmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/carbonevt/_CarbonEvtmodule.c	Wed Dec 19 03:45:37 2007
@@ -151,7 +151,7 @@
 static void EventRef_dealloc(EventRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventRef_RetainEvent(EventRefObject *_self, PyObject *_args)
@@ -495,7 +495,7 @@
 static void EventQueueRef_dealloc(EventQueueRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventQueueRef_PostEventToQueue(EventQueueRefObject *_self, PyObject *_args)
@@ -715,7 +715,7 @@
 static void EventLoopRef_dealloc(EventLoopRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventLoopRef_QuitEventLoop(EventLoopRefObject *_self, PyObject *_args)
@@ -844,7 +844,7 @@
 static void EventLoopTimerRef_dealloc(EventLoopTimerRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventLoopTimerRef_RemoveEventLoopTimer(EventLoopTimerRefObject *_self, PyObject *_args)
@@ -996,7 +996,7 @@
 		RemoveEventHandler(self->ob_itself);
 		Py_DECREF(self->ob_callback);
 	}
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHandlerRef_AddEventTypesToHandler(EventHandlerRefObject *_self, PyObject *_args)
@@ -1183,7 +1183,7 @@
 static void EventHandlerCallRef_dealloc(EventHandlerCallRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHandlerCallRef_CallNextEventHandler(EventHandlerCallRefObject *_self, PyObject *_args)
@@ -1315,7 +1315,7 @@
 static void EventTargetRef_dealloc(EventTargetRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventTargetRef_InstallStandardEventHandler(EventTargetRefObject *_self, PyObject *_args)
@@ -1469,7 +1469,7 @@
 static void EventHotKeyRef_dealloc(EventHotKeyRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *EventHotKeyRef_UnregisterEventHotKey(EventHotKeyRefObject *_self, PyObject *_args)
@@ -2152,56 +2152,56 @@
 	if (CarbonEvents_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", CarbonEvents_Error) != 0)
 		return;
-	Py_Type(&EventRef_Type) = &PyType_Type;
+	Py_TYPE(&EventRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventRef_Type) < 0) return;
 	Py_INCREF(&EventRef_Type);
 	PyModule_AddObject(m, "EventRef", (PyObject *)&EventRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventRef_Type);
 	PyModule_AddObject(m, "EventRefType", (PyObject *)&EventRef_Type);
-	Py_Type(&EventQueueRef_Type) = &PyType_Type;
+	Py_TYPE(&EventQueueRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventQueueRef_Type) < 0) return;
 	Py_INCREF(&EventQueueRef_Type);
 	PyModule_AddObject(m, "EventQueueRef", (PyObject *)&EventQueueRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventQueueRef_Type);
 	PyModule_AddObject(m, "EventQueueRefType", (PyObject *)&EventQueueRef_Type);
-	Py_Type(&EventLoopRef_Type) = &PyType_Type;
+	Py_TYPE(&EventLoopRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventLoopRef_Type) < 0) return;
 	Py_INCREF(&EventLoopRef_Type);
 	PyModule_AddObject(m, "EventLoopRef", (PyObject *)&EventLoopRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventLoopRef_Type);
 	PyModule_AddObject(m, "EventLoopRefType", (PyObject *)&EventLoopRef_Type);
-	Py_Type(&EventLoopTimerRef_Type) = &PyType_Type;
+	Py_TYPE(&EventLoopTimerRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventLoopTimerRef_Type) < 0) return;
 	Py_INCREF(&EventLoopTimerRef_Type);
 	PyModule_AddObject(m, "EventLoopTimerRef", (PyObject *)&EventLoopTimerRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventLoopTimerRef_Type);
 	PyModule_AddObject(m, "EventLoopTimerRefType", (PyObject *)&EventLoopTimerRef_Type);
-	Py_Type(&EventHandlerRef_Type) = &PyType_Type;
+	Py_TYPE(&EventHandlerRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventHandlerRef_Type) < 0) return;
 	Py_INCREF(&EventHandlerRef_Type);
 	PyModule_AddObject(m, "EventHandlerRef", (PyObject *)&EventHandlerRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventHandlerRef_Type);
 	PyModule_AddObject(m, "EventHandlerRefType", (PyObject *)&EventHandlerRef_Type);
-	Py_Type(&EventHandlerCallRef_Type) = &PyType_Type;
+	Py_TYPE(&EventHandlerCallRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventHandlerCallRef_Type) < 0) return;
 	Py_INCREF(&EventHandlerCallRef_Type);
 	PyModule_AddObject(m, "EventHandlerCallRef", (PyObject *)&EventHandlerCallRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventHandlerCallRef_Type);
 	PyModule_AddObject(m, "EventHandlerCallRefType", (PyObject *)&EventHandlerCallRef_Type);
-	Py_Type(&EventTargetRef_Type) = &PyType_Type;
+	Py_TYPE(&EventTargetRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventTargetRef_Type) < 0) return;
 	Py_INCREF(&EventTargetRef_Type);
 	PyModule_AddObject(m, "EventTargetRef", (PyObject *)&EventTargetRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&EventTargetRef_Type);
 	PyModule_AddObject(m, "EventTargetRefType", (PyObject *)&EventTargetRef_Type);
-	Py_Type(&EventHotKeyRef_Type) = &PyType_Type;
+	Py_TYPE(&EventHotKeyRef_Type) = &PyType_Type;
 	if (PyType_Ready(&EventHotKeyRef_Type) < 0) return;
 	Py_INCREF(&EventHotKeyRef_Type);
 	PyModule_AddObject(m, "EventHotKeyRef", (PyObject *)&EventHotKeyRef_Type);

Modified: python/branches/py3k/Mac/Modules/cf/_CFmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/cf/_CFmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/cf/_CFmodule.c	Wed Dec 19 03:45:37 2007
@@ -116,7 +116,7 @@
 
 PyTypeObject CFTypeRef_Type;
 
-#define CFTypeRefObj_Check(x) (Py_Type(x) == &CFTypeRef_Type || PyObject_TypeCheck((x), &CFTypeRef_Type))
+#define CFTypeRefObj_Check(x) (Py_TYPE(x) == &CFTypeRef_Type || PyObject_TypeCheck((x), &CFTypeRef_Type))
 
 typedef struct CFTypeRefObject {
 	PyObject_HEAD
@@ -161,7 +161,7 @@
 		self->ob_freeit((CFTypeRef)self->ob_itself);
 		self->ob_itself = NULL;
 	}
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CFTypeRefObj_CFGetTypeID(CFTypeRefObject *_self, PyObject *_args)
@@ -477,7 +477,7 @@
 
 PyTypeObject CFArrayRef_Type;
 
-#define CFArrayRefObj_Check(x) (Py_Type(x) == &CFArrayRef_Type || PyObject_TypeCheck((x), &CFArrayRef_Type))
+#define CFArrayRefObj_Check(x) (Py_TYPE(x) == &CFArrayRef_Type || PyObject_TypeCheck((x), &CFArrayRef_Type))
 
 typedef struct CFArrayRefObject {
 	PyObject_HEAD
@@ -687,7 +687,7 @@
 
 PyTypeObject CFMutableArrayRef_Type;
 
-#define CFMutableArrayRefObj_Check(x) (Py_Type(x) == &CFMutableArrayRef_Type || PyObject_TypeCheck((x), &CFMutableArrayRef_Type))
+#define CFMutableArrayRefObj_Check(x) (Py_TYPE(x) == &CFMutableArrayRef_Type || PyObject_TypeCheck((x), &CFMutableArrayRef_Type))
 
 typedef struct CFMutableArrayRefObject {
 	PyObject_HEAD
@@ -926,7 +926,7 @@
 
 PyTypeObject CFDictionaryRef_Type;
 
-#define CFDictionaryRefObj_Check(x) (Py_Type(x) == &CFDictionaryRef_Type || PyObject_TypeCheck((x), &CFDictionaryRef_Type))
+#define CFDictionaryRefObj_Check(x) (Py_TYPE(x) == &CFDictionaryRef_Type || PyObject_TypeCheck((x), &CFDictionaryRef_Type))
 
 typedef struct CFDictionaryRefObject {
 	PyObject_HEAD
@@ -1118,7 +1118,7 @@
 
 PyTypeObject CFMutableDictionaryRef_Type;
 
-#define CFMutableDictionaryRefObj_Check(x) (Py_Type(x) == &CFMutableDictionaryRef_Type || PyObject_TypeCheck((x), &CFMutableDictionaryRef_Type))
+#define CFMutableDictionaryRefObj_Check(x) (Py_TYPE(x) == &CFMutableDictionaryRef_Type || PyObject_TypeCheck((x), &CFMutableDictionaryRef_Type))
 
 typedef struct CFMutableDictionaryRefObject {
 	PyObject_HEAD
@@ -1294,7 +1294,7 @@
 
 PyTypeObject CFDataRef_Type;
 
-#define CFDataRefObj_Check(x) (Py_Type(x) == &CFDataRef_Type || PyObject_TypeCheck((x), &CFDataRef_Type))
+#define CFDataRefObj_Check(x) (Py_TYPE(x) == &CFDataRef_Type || PyObject_TypeCheck((x), &CFDataRef_Type))
 
 typedef struct CFDataRefObject {
 	PyObject_HEAD
@@ -1524,7 +1524,7 @@
 
 PyTypeObject CFMutableDataRef_Type;
 
-#define CFMutableDataRefObj_Check(x) (Py_Type(x) == &CFMutableDataRef_Type || PyObject_TypeCheck((x), &CFMutableDataRef_Type))
+#define CFMutableDataRefObj_Check(x) (Py_TYPE(x) == &CFMutableDataRef_Type || PyObject_TypeCheck((x), &CFMutableDataRef_Type))
 
 typedef struct CFMutableDataRefObject {
 	PyObject_HEAD
@@ -1788,7 +1788,7 @@
 
 PyTypeObject CFStringRef_Type;
 
-#define CFStringRefObj_Check(x) (Py_Type(x) == &CFStringRef_Type || PyObject_TypeCheck((x), &CFStringRef_Type))
+#define CFStringRefObj_Check(x) (Py_TYPE(x) == &CFStringRef_Type || PyObject_TypeCheck((x), &CFStringRef_Type))
 
 typedef struct CFStringRefObject {
 	PyObject_HEAD
@@ -2530,7 +2530,7 @@
 
 PyTypeObject CFMutableStringRef_Type;
 
-#define CFMutableStringRefObj_Check(x) (Py_Type(x) == &CFMutableStringRef_Type || PyObject_TypeCheck((x), &CFMutableStringRef_Type))
+#define CFMutableStringRefObj_Check(x) (Py_TYPE(x) == &CFMutableStringRef_Type || PyObject_TypeCheck((x), &CFMutableStringRef_Type))
 
 typedef struct CFMutableStringRefObject {
 	PyObject_HEAD
@@ -2917,7 +2917,7 @@
 
 PyTypeObject CFURLRef_Type;
 
-#define CFURLRefObj_Check(x) (Py_Type(x) == &CFURLRef_Type || PyObject_TypeCheck((x), &CFURLRef_Type))
+#define CFURLRefObj_Check(x) (Py_TYPE(x) == &CFURLRef_Type || PyObject_TypeCheck((x), &CFURLRef_Type))
 
 typedef struct CFURLRefObject {
 	PyObject_HEAD
@@ -4890,14 +4890,14 @@
 	if (CF_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", CF_Error) != 0)
 		return;
-	Py_Type(&CFTypeRef_Type) = &PyType_Type;
+	Py_TYPE(&CFTypeRef_Type) = &PyType_Type;
 	if (PyType_Ready(&CFTypeRef_Type) < 0) return;
 	Py_INCREF(&CFTypeRef_Type);
 	PyModule_AddObject(m, "CFTypeRef", (PyObject *)&CFTypeRef_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&CFTypeRef_Type);
 	PyModule_AddObject(m, "CFTypeRefType", (PyObject *)&CFTypeRef_Type);
-	Py_Type(&CFArrayRef_Type) = &PyType_Type;
+	Py_TYPE(&CFArrayRef_Type) = &PyType_Type;
 	CFArrayRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFArrayRef_Type) < 0) return;
 	Py_INCREF(&CFArrayRef_Type);
@@ -4905,7 +4905,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFArrayRef_Type);
 	PyModule_AddObject(m, "CFArrayRefType", (PyObject *)&CFArrayRef_Type);
-	Py_Type(&CFMutableArrayRef_Type) = &PyType_Type;
+	Py_TYPE(&CFMutableArrayRef_Type) = &PyType_Type;
 	CFMutableArrayRef_Type.tp_base = &CFArrayRef_Type;
 	if (PyType_Ready(&CFMutableArrayRef_Type) < 0) return;
 	Py_INCREF(&CFMutableArrayRef_Type);
@@ -4913,7 +4913,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableArrayRef_Type);
 	PyModule_AddObject(m, "CFMutableArrayRefType", (PyObject *)&CFMutableArrayRef_Type);
-	Py_Type(&CFDictionaryRef_Type) = &PyType_Type;
+	Py_TYPE(&CFDictionaryRef_Type) = &PyType_Type;
 	CFDictionaryRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFDictionaryRef_Type) < 0) return;
 	Py_INCREF(&CFDictionaryRef_Type);
@@ -4921,7 +4921,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFDictionaryRef_Type);
 	PyModule_AddObject(m, "CFDictionaryRefType", (PyObject *)&CFDictionaryRef_Type);
-	Py_Type(&CFMutableDictionaryRef_Type) = &PyType_Type;
+	Py_TYPE(&CFMutableDictionaryRef_Type) = &PyType_Type;
 	CFMutableDictionaryRef_Type.tp_base = &CFDictionaryRef_Type;
 	if (PyType_Ready(&CFMutableDictionaryRef_Type) < 0) return;
 	Py_INCREF(&CFMutableDictionaryRef_Type);
@@ -4929,7 +4929,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableDictionaryRef_Type);
 	PyModule_AddObject(m, "CFMutableDictionaryRefType", (PyObject *)&CFMutableDictionaryRef_Type);
-	Py_Type(&CFDataRef_Type) = &PyType_Type;
+	Py_TYPE(&CFDataRef_Type) = &PyType_Type;
 	CFDataRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFDataRef_Type) < 0) return;
 	Py_INCREF(&CFDataRef_Type);
@@ -4937,7 +4937,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFDataRef_Type);
 	PyModule_AddObject(m, "CFDataRefType", (PyObject *)&CFDataRef_Type);
-	Py_Type(&CFMutableDataRef_Type) = &PyType_Type;
+	Py_TYPE(&CFMutableDataRef_Type) = &PyType_Type;
 	CFMutableDataRef_Type.tp_base = &CFDataRef_Type;
 	if (PyType_Ready(&CFMutableDataRef_Type) < 0) return;
 	Py_INCREF(&CFMutableDataRef_Type);
@@ -4945,7 +4945,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableDataRef_Type);
 	PyModule_AddObject(m, "CFMutableDataRefType", (PyObject *)&CFMutableDataRef_Type);
-	Py_Type(&CFStringRef_Type) = &PyType_Type;
+	Py_TYPE(&CFStringRef_Type) = &PyType_Type;
 	CFStringRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFStringRef_Type) < 0) return;
 	Py_INCREF(&CFStringRef_Type);
@@ -4953,7 +4953,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFStringRef_Type);
 	PyModule_AddObject(m, "CFStringRefType", (PyObject *)&CFStringRef_Type);
-	Py_Type(&CFMutableStringRef_Type) = &PyType_Type;
+	Py_TYPE(&CFMutableStringRef_Type) = &PyType_Type;
 	CFMutableStringRef_Type.tp_base = &CFStringRef_Type;
 	if (PyType_Ready(&CFMutableStringRef_Type) < 0) return;
 	Py_INCREF(&CFMutableStringRef_Type);
@@ -4961,7 +4961,7 @@
 	/* Backward-compatible name */
 	Py_INCREF(&CFMutableStringRef_Type);
 	PyModule_AddObject(m, "CFMutableStringRefType", (PyObject *)&CFMutableStringRef_Type);
-	Py_Type(&CFURLRef_Type) = &PyType_Type;
+	Py_TYPE(&CFURLRef_Type) = &PyType_Type;
 	CFURLRef_Type.tp_base = &CFTypeRef_Type;
 	if (PyType_Ready(&CFURLRef_Type) < 0) return;
 	Py_INCREF(&CFURLRef_Type);

Modified: python/branches/py3k/Mac/Modules/cg/_CGmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/cg/_CGmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/cg/_CGmodule.c	Wed Dec 19 03:45:37 2007
@@ -95,7 +95,7 @@
 
 PyTypeObject CGContextRef_Type;
 
-#define CGContextRefObj_Check(x) (Py_Type(x) == &CGContextRef_Type || PyObject_TypeCheck((x), &CGContextRef_Type))
+#define CGContextRefObj_Check(x) (Py_TYPE(x) == &CGContextRef_Type || PyObject_TypeCheck((x), &CGContextRef_Type))
 
 typedef struct CGContextRefObject {
 	PyObject_HEAD
@@ -125,7 +125,7 @@
 static void CGContextRefObj_dealloc(CGContextRefObject *self)
 {
 	CGContextRelease(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CGContextRefObj_CGContextSaveGState(CGContextRefObject *_self, PyObject *_args)
@@ -1294,7 +1294,7 @@
 	if (CG_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", CG_Error) != 0)
 		return;
-	Py_Type(&CGContextRef_Type) = &PyType_Type;
+	Py_TYPE(&CGContextRef_Type) = &PyType_Type;
 	if (PyType_Ready(&CGContextRef_Type) < 0) return;
 	Py_INCREF(&CGContextRef_Type);
 	PyModule_AddObject(m, "CGContextRef", (PyObject *)&CGContextRef_Type);

Modified: python/branches/py3k/Mac/Modules/cm/_Cmmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/cm/_Cmmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/cm/_Cmmodule.c	Wed Dec 19 03:45:37 2007
@@ -60,7 +60,7 @@
 
 PyTypeObject ComponentInstance_Type;
 
-#define CmpInstObj_Check(x) (Py_Type(x) == &ComponentInstance_Type || PyObject_TypeCheck((x), &ComponentInstance_Type))
+#define CmpInstObj_Check(x) (Py_TYPE(x) == &ComponentInstance_Type || PyObject_TypeCheck((x), &ComponentInstance_Type))
 
 typedef struct ComponentInstanceObject {
 	PyObject_HEAD
@@ -94,7 +94,7 @@
 static void CmpInstObj_dealloc(ComponentInstanceObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CmpInstObj_CloseComponent(ComponentInstanceObject *_self, PyObject *_args)
@@ -326,7 +326,7 @@
 
 PyTypeObject Component_Type;
 
-#define CmpObj_Check(x) (Py_Type(x) == &Component_Type || PyObject_TypeCheck((x), &Component_Type))
+#define CmpObj_Check(x) (Py_TYPE(x) == &Component_Type || PyObject_TypeCheck((x), &Component_Type))
 
 typedef struct ComponentObject {
 	PyObject_HEAD
@@ -365,7 +365,7 @@
 static void CmpObj_dealloc(ComponentObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CmpObj_UnregisterComponent(ComponentObject *_self, PyObject *_args)
@@ -925,14 +925,14 @@
 	if (Cm_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Cm_Error) != 0)
 		return;
-	Py_Type(&ComponentInstance_Type) = &PyType_Type;
+	Py_TYPE(&ComponentInstance_Type) = &PyType_Type;
 	if (PyType_Ready(&ComponentInstance_Type) < 0) return;
 	Py_INCREF(&ComponentInstance_Type);
 	PyModule_AddObject(m, "ComponentInstance", (PyObject *)&ComponentInstance_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&ComponentInstance_Type);
 	PyModule_AddObject(m, "ComponentInstanceType", (PyObject *)&ComponentInstance_Type);
-	Py_Type(&Component_Type) = &PyType_Type;
+	Py_TYPE(&Component_Type) = &PyType_Type;
 	if (PyType_Ready(&Component_Type) < 0) return;
 	Py_INCREF(&Component_Type);
 	PyModule_AddObject(m, "Component", (PyObject *)&Component_Type);

Modified: python/branches/py3k/Mac/Modules/ctl/_Ctlmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/ctl/_Ctlmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/ctl/_Ctlmodule.c	Wed Dec 19 03:45:37 2007
@@ -135,7 +135,7 @@
 
 PyTypeObject Control_Type;
 
-#define CtlObj_Check(x) (Py_Type(x) == &Control_Type || PyObject_TypeCheck((x), &Control_Type))
+#define CtlObj_Check(x) (Py_TYPE(x) == &Control_Type || PyObject_TypeCheck((x), &Control_Type))
 
 typedef struct ControlObject {
 	PyObject_HEAD
@@ -170,7 +170,7 @@
 {
 	Py_XDECREF(self->ob_callbackdict);
 	if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *CtlObj_HiliteControl(ControlObject *_self, PyObject *_args)
@@ -5790,7 +5790,7 @@
 	if (Ctl_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Ctl_Error) != 0)
 		return;
-	Py_Type(&Control_Type) = &PyType_Type;
+	Py_TYPE(&Control_Type) = &PyType_Type;
 	if (PyType_Ready(&Control_Type) < 0) return;
 	Py_INCREF(&Control_Type);
 	PyModule_AddObject(m, "Control", (PyObject *)&Control_Type);

Modified: python/branches/py3k/Mac/Modules/dlg/_Dlgmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/dlg/_Dlgmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/dlg/_Dlgmodule.c	Wed Dec 19 03:45:37 2007
@@ -129,7 +129,7 @@
 
 PyTypeObject Dialog_Type;
 
-#define DlgObj_Check(x) (Py_Type(x) == &Dialog_Type || PyObject_TypeCheck((x), &Dialog_Type))
+#define DlgObj_Check(x) (Py_TYPE(x) == &Dialog_Type || PyObject_TypeCheck((x), &Dialog_Type))
 
 typedef struct DialogObject {
 	PyObject_HEAD
@@ -164,7 +164,7 @@
 static void DlgObj_dealloc(DialogObject *self)
 {
 	DisposeDialog(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *DlgObj_DrawDialog(DialogObject *_self, PyObject *_args)
@@ -1582,7 +1582,7 @@
 	if (Dlg_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Dlg_Error) != 0)
 		return;
-	Py_Type(&Dialog_Type) = &PyType_Type;
+	Py_TYPE(&Dialog_Type) = &PyType_Type;
 	if (PyType_Ready(&Dialog_Type) < 0) return;
 	Py_INCREF(&Dialog_Type);
 	PyModule_AddObject(m, "Dialog", (PyObject *)&Dialog_Type);

Modified: python/branches/py3k/Mac/Modules/drag/_Dragmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/drag/_Dragmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/drag/_Dragmodule.c	Wed Dec 19 03:45:37 2007
@@ -40,7 +40,7 @@
 
 PyTypeObject DragObj_Type;
 
-#define DragObj_Check(x) (Py_Type(x) == &DragObj_Type || PyObject_TypeCheck((x), &DragObj_Type))
+#define DragObj_Check(x) (Py_TYPE(x) == &DragObj_Type || PyObject_TypeCheck((x), &DragObj_Type))
 
 typedef struct DragObjObject {
 	PyObject_HEAD
@@ -76,7 +76,7 @@
 static void DragObj_dealloc(DragObjObject *self)
 {
 	Py_XDECREF(self->sendproc);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *DragObj_DisposeDrag(DragObjObject *_self, PyObject *_args)
@@ -1125,7 +1125,7 @@
 	if (Drag_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Drag_Error) != 0)
 		return;
-	Py_Type(&DragObj_Type) = &PyType_Type;
+	Py_TYPE(&DragObj_Type) = &PyType_Type;
 	if (PyType_Ready(&DragObj_Type) < 0) return;
 	Py_INCREF(&DragObj_Type);
 	PyModule_AddObject(m, "DragObj", (PyObject *)&DragObj_Type);

Modified: python/branches/py3k/Mac/Modules/file/_Filemodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/file/_Filemodule.c	(original)
+++ python/branches/py3k/Mac/Modules/file/_Filemodule.c	Wed Dec 19 03:45:37 2007
@@ -143,7 +143,7 @@
 
 static PyTypeObject FSCatalogInfo_Type;
 
-#define FSCatalogInfo_Check(x) (Py_Type(x) == &FSCatalogInfo_Type || PyObject_TypeCheck((x), &FSCatalogInfo_Type))
+#define FSCatalogInfo_Check(x) (Py_TYPE(x) == &FSCatalogInfo_Type || PyObject_TypeCheck((x), &FSCatalogInfo_Type))
 
 typedef struct FSCatalogInfoObject {
 	PyObject_HEAD
@@ -174,7 +174,7 @@
 static void FSCatalogInfo_dealloc(FSCatalogInfoObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef FSCatalogInfo_methods[] = {
@@ -502,7 +502,7 @@
 
 static PyTypeObject FInfo_Type;
 
-#define FInfo_Check(x) (Py_Type(x) == &FInfo_Type || PyObject_TypeCheck((x), &FInfo_Type))
+#define FInfo_Check(x) (Py_TYPE(x) == &FInfo_Type || PyObject_TypeCheck((x), &FInfo_Type))
 
 typedef struct FInfoObject {
 	PyObject_HEAD
@@ -533,7 +533,7 @@
 static void FInfo_dealloc(FInfoObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef FInfo_methods[] = {
@@ -687,7 +687,7 @@
 
 static PyTypeObject Alias_Type;
 
-#define Alias_Check(x) (Py_Type(x) == &Alias_Type || PyObject_TypeCheck((x), &Alias_Type))
+#define Alias_Check(x) (Py_TYPE(x) == &Alias_Type || PyObject_TypeCheck((x), &Alias_Type))
 
 typedef struct AliasObject {
 	PyObject_HEAD
@@ -724,7 +724,7 @@
 		self->ob_freeit(self->ob_itself);
 	}
 	self->ob_itself = NULL;
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args)
@@ -1053,7 +1053,7 @@
 static void FSSpec_dealloc(FSSpecObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *FSSpec_FSpOpenDF(FSSpecObject *_self, PyObject *_args)
@@ -1386,7 +1386,7 @@
 {
 	char buf[512];
 	PyOS_snprintf(buf, sizeof(buf), "%s((%d, %ld, '%.*s'))",
-	        Py_Type(self)->tp_name,
+	        Py_TYPE(self)->tp_name,
 	        self->ob_itself.vRefNum,
 	        self->ob_itself.parID,
 	        self->ob_itself.name[0], self->ob_itself.name+1);
@@ -1511,7 +1511,7 @@
 static void FSRef_dealloc(FSRefObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *FSRef_FSMakeFSRefUnicode(FSRefObject *_self, PyObject *_args)
@@ -3246,35 +3246,35 @@
 	if (File_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", File_Error) != 0)
 		return;
-	Py_Type(&FSCatalogInfo_Type) = &PyType_Type;
+	Py_TYPE(&FSCatalogInfo_Type) = &PyType_Type;
 	if (PyType_Ready(&FSCatalogInfo_Type) < 0) return;
 	Py_INCREF(&FSCatalogInfo_Type);
 	PyModule_AddObject(m, "FSCatalogInfo", (PyObject *)&FSCatalogInfo_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&FSCatalogInfo_Type);
 	PyModule_AddObject(m, "FSCatalogInfoType", (PyObject *)&FSCatalogInfo_Type);
-	Py_Type(&FInfo_Type) = &PyType_Type;
+	Py_TYPE(&FInfo_Type) = &PyType_Type;
 	if (PyType_Ready(&FInfo_Type) < 0) return;
 	Py_INCREF(&FInfo_Type);
 	PyModule_AddObject(m, "FInfo", (PyObject *)&FInfo_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&FInfo_Type);
 	PyModule_AddObject(m, "FInfoType", (PyObject *)&FInfo_Type);
-	Py_Type(&Alias_Type) = &PyType_Type;
+	Py_TYPE(&Alias_Type) = &PyType_Type;
 	if (PyType_Ready(&Alias_Type) < 0) return;
 	Py_INCREF(&Alias_Type);
 	PyModule_AddObject(m, "Alias", (PyObject *)&Alias_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Alias_Type);
 	PyModule_AddObject(m, "AliasType", (PyObject *)&Alias_Type);
-	Py_Type(&FSSpec_Type) = &PyType_Type;
+	Py_TYPE(&FSSpec_Type) = &PyType_Type;
 	if (PyType_Ready(&FSSpec_Type) < 0) return;
 	Py_INCREF(&FSSpec_Type);
 	PyModule_AddObject(m, "FSSpec", (PyObject *)&FSSpec_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&FSSpec_Type);
 	PyModule_AddObject(m, "FSSpecType", (PyObject *)&FSSpec_Type);
-	Py_Type(&FSRef_Type) = &PyType_Type;
+	Py_TYPE(&FSRef_Type) = &PyType_Type;
 	if (PyType_Ready(&FSRef_Type) < 0) return;
 	Py_INCREF(&FSRef_Type);
 	PyModule_AddObject(m, "FSRef", (PyObject *)&FSRef_Type);

Modified: python/branches/py3k/Mac/Modules/ibcarbon/_IBCarbon.c
==============================================================================
--- python/branches/py3k/Mac/Modules/ibcarbon/_IBCarbon.c	(original)
+++ python/branches/py3k/Mac/Modules/ibcarbon/_IBCarbon.c	Wed Dec 19 03:45:37 2007
@@ -19,7 +19,7 @@
 
 PyTypeObject IBNibRef_Type;
 
-#define IBNibRefObj_Check(x) (Py_Type(x) == &IBNibRef_Type || PyObject_TypeCheck((x), &IBNibRef_Type))
+#define IBNibRefObj_Check(x) (Py_TYPE(x) == &IBNibRef_Type || PyObject_TypeCheck((x), &IBNibRef_Type))
 
 typedef struct IBNibRefObject {
 	PyObject_HEAD
@@ -49,7 +49,7 @@
 static void IBNibRefObj_dealloc(IBNibRefObject *self)
 {
 	DisposeNibReference(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *IBNibRefObj_CreateWindowFromNib(IBNibRefObject *_self, PyObject *_args)
@@ -248,7 +248,7 @@
 	if (IBCarbon_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", IBCarbon_Error) != 0)
 		return;
-	Py_Type(&IBNibRef_Type) = &PyType_Type;
+	Py_TYPE(&IBNibRef_Type) = &PyType_Type;
 	if (PyType_Ready(&IBNibRef_Type) < 0) return;
 	Py_INCREF(&IBNibRef_Type);
 	PyModule_AddObject(m, "IBNibRef", (PyObject *)&IBNibRef_Type);

Modified: python/branches/py3k/Mac/Modules/list/_Listmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/list/_Listmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/list/_Listmodule.c	Wed Dec 19 03:45:37 2007
@@ -37,7 +37,7 @@
 
 PyTypeObject List_Type;
 
-#define ListObj_Check(x) (Py_Type(x) == &List_Type || PyObject_TypeCheck((x), &List_Type))
+#define ListObj_Check(x) (Py_TYPE(x) == &List_Type || PyObject_TypeCheck((x), &List_Type))
 
 typedef struct ListObject {
 	PyObject_HEAD
@@ -79,7 +79,7 @@
 	self->ob_ldef_func = NULL;
 	SetListRefCon(self->ob_itself, (long)0);
 	if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ListObj_LAddColumn(ListObject *_self, PyObject *_args)
@@ -1116,7 +1116,7 @@
 	if (List_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", List_Error) != 0)
 		return;
-	Py_Type(&List_Type) = &PyType_Type;
+	Py_TYPE(&List_Type) = &PyType_Type;
 	if (PyType_Ready(&List_Type) < 0) return;
 	Py_INCREF(&List_Type);
 	PyModule_AddObject(m, "List", (PyObject *)&List_Type);

Modified: python/branches/py3k/Mac/Modules/menu/_Menumodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/menu/_Menumodule.c	(original)
+++ python/branches/py3k/Mac/Modules/menu/_Menumodule.c	Wed Dec 19 03:45:37 2007
@@ -57,7 +57,7 @@
 
 PyTypeObject Menu_Type;
 
-#define MenuObj_Check(x) (Py_Type(x) == &Menu_Type || PyObject_TypeCheck((x), &Menu_Type))
+#define MenuObj_Check(x) (Py_TYPE(x) == &Menu_Type || PyObject_TypeCheck((x), &Menu_Type))
 
 typedef struct MenuObject {
 	PyObject_HEAD
@@ -87,7 +87,7 @@
 static void MenuObj_dealloc(MenuObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MenuObj_DisposeMenu(MenuObject *_self, PyObject *_args)
@@ -3455,7 +3455,7 @@
 	if (Menu_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Menu_Error) != 0)
 		return;
-	Py_Type(&Menu_Type) = &PyType_Type;
+	Py_TYPE(&Menu_Type) = &PyType_Type;
 	if (PyType_Ready(&Menu_Type) < 0) return;
 	Py_INCREF(&Menu_Type);
 	PyModule_AddObject(m, "Menu", (PyObject *)&Menu_Type);

Modified: python/branches/py3k/Mac/Modules/mlte/_Mltemodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/mlte/_Mltemodule.c	(original)
+++ python/branches/py3k/Mac/Modules/mlte/_Mltemodule.c	Wed Dec 19 03:45:37 2007
@@ -69,7 +69,7 @@
 
 PyTypeObject TXNObject_Type;
 
-#define TXNObj_Check(x) (Py_Type(x) == &TXNObject_Type || PyObject_TypeCheck((x), &TXNObject_Type))
+#define TXNObj_Check(x) (Py_TYPE(x) == &TXNObject_Type || PyObject_TypeCheck((x), &TXNObject_Type))
 
 typedef struct TXNObjectObject {
 	PyObject_HEAD
@@ -100,7 +100,7 @@
 static void TXNObj_dealloc(TXNObjectObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TXNObj_TXNDeleteObject(TXNObjectObject *_self, PyObject *_args)
@@ -1304,7 +1304,7 @@
 
 PyTypeObject TXNFontMenuObject_Type;
 
-#define TXNFontMenuObj_Check(x) (Py_Type(x) == &TXNFontMenuObject_Type || PyObject_TypeCheck((x), &TXNFontMenuObject_Type))
+#define TXNFontMenuObj_Check(x) (Py_TYPE(x) == &TXNFontMenuObject_Type || PyObject_TypeCheck((x), &TXNFontMenuObject_Type))
 
 typedef struct TXNFontMenuObjectObject {
 	PyObject_HEAD
@@ -1335,7 +1335,7 @@
 static void TXNFontMenuObj_dealloc(TXNFontMenuObjectObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TXNFontMenuObj_TXNGetFontMenuHandle(TXNFontMenuObjectObject *_self, PyObject *_args)
@@ -1659,14 +1659,14 @@
 	if (Mlte_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Mlte_Error) != 0)
 		return;
-	Py_Type(&TXNObject_Type) = &PyType_Type;
+	Py_TYPE(&TXNObject_Type) = &PyType_Type;
 	if (PyType_Ready(&TXNObject_Type) < 0) return;
 	Py_INCREF(&TXNObject_Type);
 	PyModule_AddObject(m, "TXNObject", (PyObject *)&TXNObject_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&TXNObject_Type);
 	PyModule_AddObject(m, "TXNObjectType", (PyObject *)&TXNObject_Type);
-	Py_Type(&TXNFontMenuObject_Type) = &PyType_Type;
+	Py_TYPE(&TXNFontMenuObject_Type) = &PyType_Type;
 	if (PyType_Ready(&TXNFontMenuObject_Type) < 0) return;
 	Py_INCREF(&TXNFontMenuObject_Type);
 	PyModule_AddObject(m, "TXNFontMenuObject", (PyObject *)&TXNFontMenuObject_Type);

Modified: python/branches/py3k/Mac/Modules/osa/_OSAmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/osa/_OSAmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/osa/_OSAmodule.c	Wed Dec 19 03:45:37 2007
@@ -34,7 +34,7 @@
 
 PyTypeObject OSAComponentInstance_Type;
 
-#define OSAObj_Check(x) (Py_Type(x) == &OSAComponentInstance_Type || PyObject_TypeCheck((x), &OSAComponentInstance_Type))
+#define OSAObj_Check(x) (Py_TYPE(x) == &OSAComponentInstance_Type || PyObject_TypeCheck((x), &OSAComponentInstance_Type))
 
 typedef struct OSAComponentInstanceObject {
 	PyObject_HEAD
@@ -73,7 +73,7 @@
 static void OSAObj_dealloc(OSAComponentInstanceObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *OSAObj_OSALoad(OSAComponentInstanceObject *_self, PyObject *_args)
@@ -885,7 +885,7 @@
 	if (OSA_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", OSA_Error) != 0)
 		return;
-	Py_Type(&OSAComponentInstance_Type) = &PyType_Type;
+	Py_TYPE(&OSAComponentInstance_Type) = &PyType_Type;
 	if (PyType_Ready(&OSAComponentInstance_Type) < 0) return;
 	Py_INCREF(&OSAComponentInstance_Type);
 	PyModule_AddObject(m, "OSAComponentInstance", (PyObject *)&OSAComponentInstance_Type);

Modified: python/branches/py3k/Mac/Modules/qd/_Qdmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/qd/_Qdmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/qd/_Qdmodule.c	Wed Dec 19 03:45:37 2007
@@ -73,7 +73,7 @@
 
 PyTypeObject GrafPort_Type;
 
-#define GrafObj_Check(x) (Py_Type(x) == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type))
+#define GrafObj_Check(x) (Py_TYPE(x) == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type))
 
 typedef struct GrafPortObject {
 	PyObject_HEAD
@@ -125,7 +125,7 @@
 static void GrafObj_dealloc(GrafPortObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *GrafObj_MacSetPort(GrafPortObject *_self, PyObject *_args)
@@ -1407,7 +1407,7 @@
 
 PyTypeObject BitMap_Type;
 
-#define BMObj_Check(x) (Py_Type(x) == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type))
+#define BMObj_Check(x) (Py_TYPE(x) == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type))
 
 typedef struct BitMapObject {
 	PyObject_HEAD
@@ -1443,7 +1443,7 @@
 {
 	Py_XDECREF(self->referred_object);
 	if (self->referred_bitmap) free(self->referred_bitmap);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *BMObj_getdata(BitMapObject *_self, PyObject *_args)
@@ -7122,14 +7122,14 @@
 	if (Qd_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Qd_Error) != 0)
 		return;
-	Py_Type(&GrafPort_Type) = &PyType_Type;
+	Py_TYPE(&GrafPort_Type) = &PyType_Type;
 	if (PyType_Ready(&GrafPort_Type) < 0) return;
 	Py_INCREF(&GrafPort_Type);
 	PyModule_AddObject(m, "GrafPort", (PyObject *)&GrafPort_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&GrafPort_Type);
 	PyModule_AddObject(m, "GrafPortType", (PyObject *)&GrafPort_Type);
-	Py_Type(&BitMap_Type) = &PyType_Type;
+	Py_TYPE(&BitMap_Type) = &PyType_Type;
 	if (PyType_Ready(&BitMap_Type) < 0) return;
 	Py_INCREF(&BitMap_Type);
 	PyModule_AddObject(m, "BitMap", (PyObject *)&BitMap_Type);

Modified: python/branches/py3k/Mac/Modules/qdoffs/_Qdoffsmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/qdoffs/_Qdoffsmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/qdoffs/_Qdoffsmodule.c	Wed Dec 19 03:45:37 2007
@@ -34,7 +34,7 @@
 
 PyTypeObject GWorld_Type;
 
-#define GWorldObj_Check(x) (Py_Type(x) == &GWorld_Type || PyObject_TypeCheck((x), &GWorld_Type))
+#define GWorldObj_Check(x) (Py_TYPE(x) == &GWorld_Type || PyObject_TypeCheck((x), &GWorld_Type))
 
 typedef struct GWorldObject {
 	PyObject_HEAD
@@ -65,7 +65,7 @@
 static void GWorldObj_dealloc(GWorldObject *self)
 {
 	DisposeGWorld(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args)
@@ -700,7 +700,7 @@
 	if (Qdoffs_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Qdoffs_Error) != 0)
 		return;
-	Py_Type(&GWorld_Type) = &PyType_Type;
+	Py_TYPE(&GWorld_Type) = &PyType_Type;
 	if (PyType_Ready(&GWorld_Type) < 0) return;
 	Py_INCREF(&GWorld_Type);
 	PyModule_AddObject(m, "GWorld", (PyObject *)&GWorld_Type);

Modified: python/branches/py3k/Mac/Modules/qt/_Qtmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/qt/_Qtmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/qt/_Qtmodule.c	Wed Dec 19 03:45:37 2007
@@ -97,7 +97,7 @@
 
 PyTypeObject IdleManager_Type;
 
-#define IdleManagerObj_Check(x) (Py_Type(x) == &IdleManager_Type || PyObject_TypeCheck((x), &IdleManager_Type))
+#define IdleManagerObj_Check(x) (Py_TYPE(x) == &IdleManager_Type || PyObject_TypeCheck((x), &IdleManager_Type))
 
 typedef struct IdleManagerObject {
 	PyObject_HEAD
@@ -136,7 +136,7 @@
 static void IdleManagerObj_dealloc(IdleManagerObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef IdleManagerObj_methods[] = {
@@ -220,7 +220,7 @@
 
 PyTypeObject MovieController_Type;
 
-#define MovieCtlObj_Check(x) (Py_Type(x) == &MovieController_Type || PyObject_TypeCheck((x), &MovieController_Type))
+#define MovieCtlObj_Check(x) (Py_TYPE(x) == &MovieController_Type || PyObject_TypeCheck((x), &MovieController_Type))
 
 typedef struct MovieControllerObject {
 	PyObject_HEAD
@@ -259,7 +259,7 @@
 static void MovieCtlObj_dealloc(MovieControllerObject *self)
 {
 	if (self->ob_itself) DisposeMovieController(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MovieCtlObj_MCSetMovie(MovieControllerObject *_self, PyObject *_args)
@@ -1339,7 +1339,7 @@
 
 PyTypeObject TimeBase_Type;
 
-#define TimeBaseObj_Check(x) (Py_Type(x) == &TimeBase_Type || PyObject_TypeCheck((x), &TimeBase_Type))
+#define TimeBaseObj_Check(x) (Py_TYPE(x) == &TimeBase_Type || PyObject_TypeCheck((x), &TimeBase_Type))
 
 typedef struct TimeBaseObject {
 	PyObject_HEAD
@@ -1378,7 +1378,7 @@
 static void TimeBaseObj_dealloc(TimeBaseObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TimeBaseObj_DisposeTimeBase(TimeBaseObject *_self, PyObject *_args)
@@ -1832,7 +1832,7 @@
 
 PyTypeObject UserData_Type;
 
-#define UserDataObj_Check(x) (Py_Type(x) == &UserData_Type || PyObject_TypeCheck((x), &UserData_Type))
+#define UserDataObj_Check(x) (Py_TYPE(x) == &UserData_Type || PyObject_TypeCheck((x), &UserData_Type))
 
 typedef struct UserDataObject {
 	PyObject_HEAD
@@ -1871,7 +1871,7 @@
 static void UserDataObj_dealloc(UserDataObject *self)
 {
 	if (self->ob_itself) DisposeUserData(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *UserDataObj_GetUserData(UserDataObject *_self, PyObject *_args)
@@ -2202,7 +2202,7 @@
 
 PyTypeObject Media_Type;
 
-#define MediaObj_Check(x) (Py_Type(x) == &Media_Type || PyObject_TypeCheck((x), &Media_Type))
+#define MediaObj_Check(x) (Py_TYPE(x) == &Media_Type || PyObject_TypeCheck((x), &Media_Type))
 
 typedef struct MediaObject {
 	PyObject_HEAD
@@ -2241,7 +2241,7 @@
 static void MediaObj_dealloc(MediaObject *self)
 {
 	if (self->ob_itself) DisposeTrackMedia(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MediaObj_LoadMediaIntoRam(MediaObject *_self, PyObject *_args)
@@ -3443,7 +3443,7 @@
 
 PyTypeObject Track_Type;
 
-#define TrackObj_Check(x) (Py_Type(x) == &Track_Type || PyObject_TypeCheck((x), &Track_Type))
+#define TrackObj_Check(x) (Py_TYPE(x) == &Track_Type || PyObject_TypeCheck((x), &Track_Type))
 
 typedef struct TrackObject {
 	PyObject_HEAD
@@ -3482,7 +3482,7 @@
 static void TrackObj_dealloc(TrackObject *self)
 {
 	if (self->ob_itself) DisposeMovieTrack(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TrackObj_LoadTrackIntoRam(TrackObject *_self, PyObject *_args)
@@ -4790,7 +4790,7 @@
 
 PyTypeObject Movie_Type;
 
-#define MovieObj_Check(x) (Py_Type(x) == &Movie_Type || PyObject_TypeCheck((x), &Movie_Type))
+#define MovieObj_Check(x) (Py_TYPE(x) == &Movie_Type || PyObject_TypeCheck((x), &Movie_Type))
 
 typedef struct MovieObject {
 	PyObject_HEAD
@@ -4829,7 +4829,7 @@
 static void MovieObj_dealloc(MovieObject *self)
 {
 	if (self->ob_itself) DisposeMovie(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *MovieObj_MoviesTask(MovieObject *_self, PyObject *_args)
@@ -7342,7 +7342,7 @@
 
 PyTypeObject SGOutput_Type;
 
-#define SGOutputObj_Check(x) (Py_Type(x) == &SGOutput_Type || PyObject_TypeCheck((x), &SGOutput_Type))
+#define SGOutputObj_Check(x) (Py_TYPE(x) == &SGOutput_Type || PyObject_TypeCheck((x), &SGOutput_Type))
 
 typedef struct SGOutputObject {
 	PyObject_HEAD
@@ -7381,7 +7381,7 @@
 static void SGOutputObj_dealloc(SGOutputObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyMethodDef SGOutputObj_methods[] = {
@@ -28013,56 +28013,56 @@
 	if (Qt_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Qt_Error) != 0)
 		return;
-	Py_Type(&IdleManager_Type) = &PyType_Type;
+	Py_TYPE(&IdleManager_Type) = &PyType_Type;
 	if (PyType_Ready(&IdleManager_Type) < 0) return;
 	Py_INCREF(&IdleManager_Type);
 	PyModule_AddObject(m, "IdleManager", (PyObject *)&IdleManager_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&IdleManager_Type);
 	PyModule_AddObject(m, "IdleManagerType", (PyObject *)&IdleManager_Type);
-	Py_Type(&MovieController_Type) = &PyType_Type;
+	Py_TYPE(&MovieController_Type) = &PyType_Type;
 	if (PyType_Ready(&MovieController_Type) < 0) return;
 	Py_INCREF(&MovieController_Type);
 	PyModule_AddObject(m, "MovieController", (PyObject *)&MovieController_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&MovieController_Type);
 	PyModule_AddObject(m, "MovieControllerType", (PyObject *)&MovieController_Type);
-	Py_Type(&TimeBase_Type) = &PyType_Type;
+	Py_TYPE(&TimeBase_Type) = &PyType_Type;
 	if (PyType_Ready(&TimeBase_Type) < 0) return;
 	Py_INCREF(&TimeBase_Type);
 	PyModule_AddObject(m, "TimeBase", (PyObject *)&TimeBase_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&TimeBase_Type);
 	PyModule_AddObject(m, "TimeBaseType", (PyObject *)&TimeBase_Type);
-	Py_Type(&UserData_Type) = &PyType_Type;
+	Py_TYPE(&UserData_Type) = &PyType_Type;
 	if (PyType_Ready(&UserData_Type) < 0) return;
 	Py_INCREF(&UserData_Type);
 	PyModule_AddObject(m, "UserData", (PyObject *)&UserData_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&UserData_Type);
 	PyModule_AddObject(m, "UserDataType", (PyObject *)&UserData_Type);
-	Py_Type(&Media_Type) = &PyType_Type;
+	Py_TYPE(&Media_Type) = &PyType_Type;
 	if (PyType_Ready(&Media_Type) < 0) return;
 	Py_INCREF(&Media_Type);
 	PyModule_AddObject(m, "Media", (PyObject *)&Media_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Media_Type);
 	PyModule_AddObject(m, "MediaType", (PyObject *)&Media_Type);
-	Py_Type(&Track_Type) = &PyType_Type;
+	Py_TYPE(&Track_Type) = &PyType_Type;
 	if (PyType_Ready(&Track_Type) < 0) return;
 	Py_INCREF(&Track_Type);
 	PyModule_AddObject(m, "Track", (PyObject *)&Track_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Track_Type);
 	PyModule_AddObject(m, "TrackType", (PyObject *)&Track_Type);
-	Py_Type(&Movie_Type) = &PyType_Type;
+	Py_TYPE(&Movie_Type) = &PyType_Type;
 	if (PyType_Ready(&Movie_Type) < 0) return;
 	Py_INCREF(&Movie_Type);
 	PyModule_AddObject(m, "Movie", (PyObject *)&Movie_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&Movie_Type);
 	PyModule_AddObject(m, "MovieType", (PyObject *)&Movie_Type);
-	Py_Type(&SGOutput_Type) = &PyType_Type;
+	Py_TYPE(&SGOutput_Type) = &PyType_Type;
 	if (PyType_Ready(&SGOutput_Type) < 0) return;
 	Py_INCREF(&SGOutput_Type);
 	PyModule_AddObject(m, "SGOutput", (PyObject *)&SGOutput_Type);

Modified: python/branches/py3k/Mac/Modules/res/_Resmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/res/_Resmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/res/_Resmodule.c	Wed Dec 19 03:45:37 2007
@@ -41,7 +41,7 @@
 
 PyTypeObject Resource_Type;
 
-#define ResObj_Check(x) (Py_Type(x) == &Resource_Type || PyObject_TypeCheck((x), &Resource_Type))
+#define ResObj_Check(x) (Py_TYPE(x) == &Resource_Type || PyObject_TypeCheck((x), &Resource_Type))
 
 typedef struct ResourceObject {
 	PyObject_HEAD
@@ -89,7 +89,7 @@
 		self->ob_freeit(self->ob_itself);
 	}
 	self->ob_itself = NULL;
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ResObj_HomeResFile(ResourceObject *_self, PyObject *_args)
@@ -1730,7 +1730,7 @@
 	if (Res_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Res_Error) != 0)
 		return;
-	Py_Type(&Resource_Type) = &PyType_Type;
+	Py_TYPE(&Resource_Type) = &PyType_Type;
 	if (PyType_Ready(&Resource_Type) < 0) return;
 	Py_INCREF(&Resource_Type);
 	PyModule_AddObject(m, "Resource", (PyObject *)&Resource_Type);

Modified: python/branches/py3k/Mac/Modules/scrap/_Scrapmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/scrap/_Scrapmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/scrap/_Scrapmodule.c	Wed Dec 19 03:45:37 2007
@@ -23,7 +23,7 @@
 
 PyTypeObject Scrap_Type;
 
-#define ScrapObj_Check(x) (Py_Type(x) == &Scrap_Type || PyObject_TypeCheck((x), &Scrap_Type))
+#define ScrapObj_Check(x) (Py_TYPE(x) == &Scrap_Type || PyObject_TypeCheck((x), &Scrap_Type))
 
 typedef struct ScrapObject {
 	PyObject_HEAD
@@ -52,7 +52,7 @@
 static void ScrapObj_dealloc(ScrapObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *ScrapObj_GetScrapFlavorFlags(ScrapObject *_self, PyObject *_args)
@@ -346,7 +346,7 @@
 	if (Scrap_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Scrap_Error) != 0)
 		return;
-	Py_Type(&Scrap_Type) = &PyType_Type;
+	Py_TYPE(&Scrap_Type) = &PyType_Type;
 	Py_INCREF(&Scrap_Type);
 	if (PyDict_SetItemString(d, "ScrapType", (PyObject *)&Scrap_Type) != 0)
 		Py_FatalError("can't initialize ScrapType");

Modified: python/branches/py3k/Mac/Modules/snd/_Sndmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/snd/_Sndmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/snd/_Sndmodule.c	Wed Dec 19 03:45:37 2007
@@ -42,7 +42,7 @@
 
 static PyTypeObject SndChannel_Type;
 
-#define SndCh_Check(x) (Py_Type(x) == &SndChannel_Type || PyObject_TypeCheck((x), &SndChannel_Type))
+#define SndCh_Check(x) (Py_TYPE(x) == &SndChannel_Type || PyObject_TypeCheck((x), &SndChannel_Type))
 
 typedef struct SndChannelObject {
 	PyObject_HEAD
@@ -256,7 +256,7 @@
 
 static PyTypeObject SPB_Type;
 
-#define SPBObj_Check(x) (Py_Type(x) == &SPB_Type || PyObject_TypeCheck((x), &SPB_Type))
+#define SPBObj_Check(x) (Py_TYPE(x) == &SPB_Type || PyObject_TypeCheck((x), &SPB_Type))
 
 typedef struct SPBObject {
 	PyObject_HEAD
@@ -1129,14 +1129,14 @@
 	if (Snd_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Snd_Error) != 0)
 		return;
-	Py_Type(&SndChannel_Type) = &PyType_Type;
+	Py_TYPE(&SndChannel_Type) = &PyType_Type;
 	if (PyType_Ready(&SndChannel_Type) < 0) return;
 	Py_INCREF(&SndChannel_Type);
 	PyModule_AddObject(m, "SndChannel", (PyObject *)&SndChannel_Type);
 	/* Backward-compatible name */
 	Py_INCREF(&SndChannel_Type);
 	PyModule_AddObject(m, "SndChannelType", (PyObject *)&SndChannel_Type);
-	Py_Type(&SPB_Type) = &PyType_Type;
+	Py_TYPE(&SPB_Type) = &PyType_Type;
 	if (PyType_Ready(&SPB_Type) < 0) return;
 	Py_INCREF(&SPB_Type);
 	PyModule_AddObject(m, "SPB", (PyObject *)&SPB_Type);

Modified: python/branches/py3k/Mac/Modules/te/_TEmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/te/_TEmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/te/_TEmodule.c	Wed Dec 19 03:45:37 2007
@@ -58,7 +58,7 @@
 
 PyTypeObject TE_Type;
 
-#define TEObj_Check(x) (Py_Type(x) == &TE_Type || PyObject_TypeCheck((x), &TE_Type))
+#define TEObj_Check(x) (Py_TYPE(x) == &TE_Type || PyObject_TypeCheck((x), &TE_Type))
 
 typedef struct TEObject {
 	PyObject_HEAD
@@ -92,7 +92,7 @@
 static void TEObj_dealloc(TEObject *self)
 {
 	TEDispose(self->ob_itself);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *TEObj_TESetText(TEObject *_self, PyObject *_args)
@@ -1317,7 +1317,7 @@
 	if (TE_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", TE_Error) != 0)
 		return;
-	Py_Type(&TE_Type) = &PyType_Type;
+	Py_TYPE(&TE_Type) = &PyType_Type;
 	if (PyType_Ready(&TE_Type) < 0) return;
 	Py_INCREF(&TE_Type);
 	PyModule_AddObject(m, "TE", (PyObject *)&TE_Type);

Modified: python/branches/py3k/Mac/Modules/win/_Winmodule.c
==============================================================================
--- python/branches/py3k/Mac/Modules/win/_Winmodule.c	(original)
+++ python/branches/py3k/Mac/Modules/win/_Winmodule.c	Wed Dec 19 03:45:37 2007
@@ -45,7 +45,7 @@
 
 PyTypeObject Window_Type;
 
-#define WinObj_Check(x) (Py_Type(x) == &Window_Type || PyObject_TypeCheck((x), &Window_Type))
+#define WinObj_Check(x) (Py_TYPE(x) == &Window_Type || PyObject_TypeCheck((x), &Window_Type))
 
 typedef struct WindowObject {
 	PyObject_HEAD
@@ -102,7 +102,7 @@
 	}
 	self->ob_itself = NULL;
 	self->ob_freeit = NULL;
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *WinObj_GetWindowOwnerCount(WindowObject *_self, PyObject *_args)
@@ -3244,7 +3244,7 @@
 	if (Win_Error == NULL ||
 	    PyDict_SetItemString(d, "Error", Win_Error) != 0)
 		return;
-	Py_Type(&Window_Type) = &PyType_Type;
+	Py_TYPE(&Window_Type) = &PyType_Type;
 	if (PyType_Ready(&Window_Type) < 0) return;
 	Py_INCREF(&Window_Type);
 	PyModule_AddObject(m, "Window", (PyObject *)&Window_Type);

Modified: python/branches/py3k/Modules/_bsddb.c
==============================================================================
--- python/branches/py3k/Modules/_bsddb.c	(original)
+++ python/branches/py3k/Modules/_bsddb.c	Wed Dec 19 03:45:37 2007
@@ -203,13 +203,13 @@
 
 static PyTypeObject DB_Type, DBCursor_Type, DBEnv_Type, DBTxn_Type, DBLock_Type;
 
-#define DBObject_Check(v)           (Py_Type(v) == &DB_Type)
-#define DBCursorObject_Check(v)     (Py_Type(v) == &DBCursor_Type)
-#define DBEnvObject_Check(v)        (Py_Type(v) == &DBEnv_Type)
-#define DBTxnObject_Check(v)        (Py_Type(v) == &DBTxn_Type)
-#define DBLockObject_Check(v)       (Py_Type(v) == &DBLock_Type)
+#define DBObject_Check(v)           (Py_TYPE(v) == &DB_Type)
+#define DBCursorObject_Check(v)     (Py_TYPE(v) == &DBCursor_Type)
+#define DBEnvObject_Check(v)        (Py_TYPE(v) == &DBEnv_Type)
+#define DBTxnObject_Check(v)        (Py_TYPE(v) == &DBTxn_Type)
+#define DBLockObject_Check(v)       (Py_TYPE(v) == &DBLock_Type)
 #if (DBVER >= 43)
-#define DBSequenceObject_Check(v)   (Py_Type(v) == &DBSequence_Type)
+#define DBSequenceObject_Check(v)   (Py_TYPE(v) == &DBSequence_Type)
 #endif
 
 
@@ -461,7 +461,7 @@
     else {
         PyErr_Format(PyExc_TypeError,
                      "buffer or int object expected for key, %s found",
-                     Py_Type(keyobj)->tp_name);
+                     Py_TYPE(keyobj)->tp_name);
         return 0;
     }
 
@@ -611,7 +611,7 @@
 static void makeTypeError(char* expected, PyObject* found)
 {
     PyErr_Format(PyExc_TypeError, "Expected %s argument, %s found.",
-                 expected, Py_Type(found)->tp_name);
+                 expected, Py_TYPE(found)->tp_name);
 }
 
 
@@ -1176,7 +1176,7 @@
             Py_ssize_t size;
 
             CLEAR_DBT(*secKey);
-            size = Py_Size(result);
+            size = Py_SIZE(result);
             if (PyBytes_Check(result))
                 data = PyBytes_AS_STRING(result);
             else
@@ -5656,13 +5656,13 @@
 
     /* Initialize the type of the new type objects here; doing it here
        is required for portability to Windows without requiring C++. */
-    Py_Type(&DB_Type) = &PyType_Type;
-    Py_Type(&DBCursor_Type) = &PyType_Type;
-    Py_Type(&DBEnv_Type) = &PyType_Type;
-    Py_Type(&DBTxn_Type) = &PyType_Type;
-    Py_Type(&DBLock_Type) = &PyType_Type;
+    Py_TYPE(&DB_Type) = &PyType_Type;
+    Py_TYPE(&DBCursor_Type) = &PyType_Type;
+    Py_TYPE(&DBEnv_Type) = &PyType_Type;
+    Py_TYPE(&DBTxn_Type) = &PyType_Type;
+    Py_TYPE(&DBLock_Type) = &PyType_Type;
 #if (DBVER >= 43)    
-    Py_Type(&DBSequence_Type) = &PyType_Type;
+    Py_TYPE(&DBSequence_Type) = &PyType_Type;
 #endif    
 
 

Modified: python/branches/py3k/Modules/_collectionsmodule.c
==============================================================================
--- python/branches/py3k/Modules/_collectionsmodule.c	(original)
+++ python/branches/py3k/Modules/_collectionsmodule.c	Wed Dec 19 03:45:37 2007
@@ -583,7 +583,7 @@
 	}
 	deque->leftblock = NULL;
 	deque->rightblock = NULL;
-	Py_Type(deque)->tp_free(deque);
+	Py_TYPE(deque)->tp_free(deque);
 }
 
 static int
@@ -619,9 +619,9 @@
 deque_copy(PyObject *deque)
 {
 	if (((dequeobject *)deque)->maxlen == -1)
-		return PyObject_CallFunction((PyObject *)(Py_Type(deque)), "O", deque, NULL);
+		return PyObject_CallFunction((PyObject *)(Py_TYPE(deque)), "O", deque, NULL);
 	else
-		return PyObject_CallFunction((PyObject *)(Py_Type(deque)), "Oi",
+		return PyObject_CallFunction((PyObject *)(Py_TYPE(deque)), "Oi",
 			deque, ((dequeobject *)deque)->maxlen, NULL);
 }
 
@@ -642,14 +642,14 @@
 	}
 	if (dict == NULL) {
 		if (deque->maxlen == -1)
-			result = Py_BuildValue("O(O)", Py_Type(deque), aslist);
+			result = Py_BuildValue("O(O)", Py_TYPE(deque), aslist);
 		else
-			result = Py_BuildValue("O(Oi)", Py_Type(deque), aslist, deque->maxlen);
+			result = Py_BuildValue("O(Oi)", Py_TYPE(deque), aslist, deque->maxlen);
 	} else {
 		if (deque->maxlen == -1)
-			result = Py_BuildValue("O(OO)O", Py_Type(deque), aslist, Py_None, dict);
+			result = Py_BuildValue("O(OO)O", Py_TYPE(deque), aslist, Py_None, dict);
 		else
-			result = Py_BuildValue("O(Oi)O", Py_Type(deque), aslist, deque->maxlen, dict);
+			result = Py_BuildValue("O(Oi)O", Py_TYPE(deque), aslist, deque->maxlen, dict);
 	}
 	Py_XDECREF(dict);
 	Py_DECREF(aslist);
@@ -921,7 +921,7 @@
 dequeiter_dealloc(dequeiterobject *dio)
 {
 	Py_XDECREF(dio->deque);
-	Py_Type(dio)->tp_free(dio);
+	Py_TYPE(dio)->tp_free(dio);
 }
 
 static PyObject *
@@ -1129,7 +1129,7 @@
 	   whose class constructor has the same signature.  Subclasses that
 	   define a different constructor signature must override copy().
 	*/
-	return PyObject_CallFunctionObjArgs((PyObject*)Py_Type(dd),
+	return PyObject_CallFunctionObjArgs((PyObject*)Py_TYPE(dd),
 					    dd->default_factory, dd, NULL);
 }
 
@@ -1172,7 +1172,7 @@
 		Py_DECREF(args);
 		return NULL;
 	}
-	result = PyTuple_Pack(5, Py_Type(dd), args,
+	result = PyTuple_Pack(5, Py_TYPE(dd), args,
 			      Py_None, Py_None, items);
 	Py_DECREF(items);
 	Py_DECREF(args);

Modified: python/branches/py3k/Modules/_csv.c
==============================================================================
--- python/branches/py3k/Modules/_csv.c	(original)
+++ python/branches/py3k/Modules/_csv.c	Wed Dec 19 03:45:37 2007
@@ -81,7 +81,7 @@
 
 static PyTypeObject Reader_Type;
 
-#define ReaderObject_Check(v)   (Py_Type(v) == &Reader_Type)
+#define ReaderObject_Check(v)   (Py_TYPE(v) == &Reader_Type)
 
 typedef struct {
         PyObject_HEAD
@@ -284,7 +284,7 @@
 Dialect_dealloc(DialectObj *self)
 {
         Py_XDECREF(self->lineterminator);
-        Py_Type(self)->tp_free((PyObject *)self);
+        Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static char *dialect_kws[] = {

Modified: python/branches/py3k/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/py3k/Modules/_ctypes/_ctypes.c	(original)
+++ python/branches/py3k/Modules/_ctypes/_ctypes.c	Wed Dec 19 03:45:37 2007
@@ -328,7 +328,7 @@
 			Py_INCREF(value);
 			return value;
 		}
-		ob_name = (ob) ? Py_Type(ob)->tp_name : "???";
+		ob_name = (ob) ? Py_TYPE(ob)->tp_name : "???";
 		PyErr_Format(PyExc_TypeError,
 			     "expected %s instance instead of pointer to %s",
 			     ((PyTypeObject *)type)->tp_name, ob_name);
@@ -344,7 +344,7 @@
 	PyErr_Format(PyExc_TypeError,
 		     "expected %s instance instead of %s",
 		     ((PyTypeObject *)type)->tp_name,
-		     Py_Type(value)->tp_name);
+		     Py_TYPE(value)->tp_name);
 	return NULL;
 }
 
@@ -798,7 +798,7 @@
 	} else if (!PyString_Check(value)) {
 		PyErr_Format(PyExc_TypeError,
 			     "str/bytes expected instead of %s instance",
-			     Py_Type(value)->tp_name);
+			     Py_TYPE(value)->tp_name);
 		return -1;
 	} else
 		Py_INCREF(value);
@@ -858,7 +858,7 @@
 	} else if (!PyUnicode_Check(value)) {
 		PyErr_Format(PyExc_TypeError,
 				"unicode string expected instead of %s instance",
-				Py_Type(value)->tp_name);
+				Py_TYPE(value)->tp_name);
 		return -1;
 	} else
 		Py_INCREF(value);
@@ -2075,7 +2075,7 @@
 CData_dealloc(PyObject *self)
 {
 	CData_clear((CDataObject *)self);
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static PyMemberDef CData_members[] = {
@@ -2334,7 +2334,7 @@
 			PyErr_Format(PyExc_TypeError,
 				     "expected %s instance, got %s",
 				     ((PyTypeObject *)type)->tp_name,
-				     Py_Type(value)->tp_name);
+				     Py_TYPE(value)->tp_name);
 			return NULL;
 		}
 	}
@@ -2365,7 +2365,7 @@
 		if (p1->proto != p2->proto) {
 			PyErr_Format(PyExc_TypeError,
 				     "incompatible types, %s instance instead of %s instance",
-				     Py_Type(value)->tp_name,
+				     Py_TYPE(value)->tp_name,
 				     ((PyTypeObject *)type)->tp_name);
 			return NULL;
 		}
@@ -2384,7 +2384,7 @@
 	}
 	PyErr_Format(PyExc_TypeError,
 		     "incompatible types, %s instance instead of %s instance",
-		     Py_Type(value)->tp_name,
+		     Py_TYPE(value)->tp_name,
 		     ((PyTypeObject *)type)->tp_name);
 	return NULL;
 }
@@ -2645,7 +2645,7 @@
 		     Py_SAFE_DOWNCAST(index, Py_ssize_t, int),
 		     PyType_Check(arg) ?
 		     ((PyTypeObject *)arg)->tp_name :
-		     Py_Type(arg)->tp_name);
+		     Py_TYPE(arg)->tp_name);
 	return 0;
 }
 
@@ -3430,7 +3430,7 @@
 CFuncPtr_dealloc(CFuncPtrObject *self)
 {
 	CFuncPtr_clear(self);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *
@@ -3440,11 +3440,11 @@
 	if (self->index)
 		return PyUnicode_FromFormat("<COM method offset %d: %s at %p>",
 					   self->index - 0x1000,
-					   Py_Type(self)->tp_name,
+					   Py_TYPE(self)->tp_name,
 					   self);
 #endif
 	return PyUnicode_FromFormat("<%s object at %p>",
-				   Py_Type(self)->tp_name,
+				   Py_TYPE(self)->tp_name,
 				   self);
 }
 
@@ -4078,7 +4078,7 @@
 static PyObject *
 Simple_from_outparm(PyObject *self, PyObject *args)
 {
-	if (IsSimpleSubType((PyObject *)Py_Type(self))) {
+	if (IsSimpleSubType((PyObject *)Py_TYPE(self))) {
 		Py_INCREF(self);
 		return self;
 	}
@@ -4116,9 +4116,9 @@
 	PyObject *val, *name, *args, *result;
 	static PyObject *format;
 
-	if (Py_Type(self)->tp_base != &Simple_Type) {
+	if (Py_TYPE(self)->tp_base != &Simple_Type) {
 		return PyUnicode_FromFormat("<%s object at %p>",
-					   Py_Type(self)->tp_name, self);
+					   Py_TYPE(self)->tp_name, self);
 	}
 
 	if (format == NULL) {
@@ -4131,7 +4131,7 @@
 	if (val == NULL)
 		return NULL;
 
-	name = PyUnicode_FromString(Py_Type(self)->tp_name);
+	name = PyUnicode_FromString(Py_TYPE(self)->tp_name);
 	if (name == NULL) {
 		Py_DECREF(val);
 		return NULL;
@@ -4302,7 +4302,7 @@
 		PyErr_Format(PyExc_TypeError,
 			     "expected %s instead of %s",
 			     ((PyTypeObject *)(stgdict->proto))->tp_name,
-			     Py_Type(value)->tp_name);
+			     Py_TYPE(value)->tp_name);
 		return -1;
 	}
 
@@ -4588,7 +4588,7 @@
     PyObject *a;
     int status;
 
-    if (!_PyArg_NoKeywords(Py_Type(self)->tp_name, kwds))
+    if (!_PyArg_NoKeywords(Py_TYPE(self)->tp_name, kwds))
         return -1;
 
     if (!PyArg_ParseTuple(args, "OOO:COMError", &hresult, &text, &details))
@@ -4703,7 +4703,7 @@
 		     "cast() argument 2 must be a pointer type, not %s",
 		     PyType_Check(arg)
 		     ? ((PyTypeObject *)arg)->tp_name
-		     : Py_Type(arg)->tp_name);
+		     : Py_TYPE(arg)->tp_name);
 	return 0;
 }
 
@@ -4830,37 +4830,37 @@
 	if (PyType_Ready(&CData_Type) < 0)
 		return;
 
-	Py_Type(&Struct_Type) = &StructType_Type;
+	Py_TYPE(&Struct_Type) = &StructType_Type;
 	Struct_Type.tp_base = &CData_Type;
 	if (PyType_Ready(&Struct_Type) < 0)
 		return;
 	PyModule_AddObject(m, "Structure", (PyObject *)&Struct_Type);
 
-	Py_Type(&Union_Type) = &UnionType_Type;
+	Py_TYPE(&Union_Type) = &UnionType_Type;
 	Union_Type.tp_base = &CData_Type;
 	if (PyType_Ready(&Union_Type) < 0)
 		return;
 	PyModule_AddObject(m, "Union", (PyObject *)&Union_Type);
 
-	Py_Type(&Pointer_Type) = &PointerType_Type;
+	Py_TYPE(&Pointer_Type) = &PointerType_Type;
 	Pointer_Type.tp_base = &CData_Type;
 	if (PyType_Ready(&Pointer_Type) < 0)
 		return;
 	PyModule_AddObject(m, "_Pointer", (PyObject *)&Pointer_Type);
 
-	Py_Type(&Array_Type) = &ArrayType_Type;
+	Py_TYPE(&Array_Type) = &ArrayType_Type;
 	Array_Type.tp_base = &CData_Type;
 	if (PyType_Ready(&Array_Type) < 0)
 		return;
 	PyModule_AddObject(m, "Array", (PyObject *)&Array_Type);
 
-	Py_Type(&Simple_Type) = &SimpleType_Type;
+	Py_TYPE(&Simple_Type) = &SimpleType_Type;
 	Simple_Type.tp_base = &CData_Type;
 	if (PyType_Ready(&Simple_Type) < 0)
 		return;
 	PyModule_AddObject(m, "_SimpleCData", (PyObject *)&Simple_Type);
 
-	Py_Type(&CFuncPtr_Type) = &CFuncPtrType_Type;
+	Py_TYPE(&CFuncPtr_Type) = &CFuncPtrType_Type;
 	CFuncPtr_Type.tp_base = &CData_Type;
 	if (PyType_Ready(&CFuncPtr_Type) < 0)
 		return;

Modified: python/branches/py3k/Modules/_ctypes/callproc.c
==============================================================================
--- python/branches/py3k/Modules/_ctypes/callproc.c	(original)
+++ python/branches/py3k/Modules/_ctypes/callproc.c	Wed Dec 19 03:45:37 2007
@@ -1153,7 +1153,7 @@
 	if (!CDataObject_Check(pcom) || (pcom->b_size != sizeof(void *))) {
 		PyErr_Format(PyExc_TypeError,
 			     "COM Pointer expected instead of %s instance",
-			     Py_Type(pcom)->tp_name);
+			     Py_TYPE(pcom)->tp_name);
 		return NULL;
 	}
 
@@ -1393,7 +1393,7 @@
 	if (!CDataObject_Check(obj)) {
 		PyErr_Format(PyExc_TypeError,
 			     "byref() argument must be a ctypes instance, not '%s'",
-			     Py_Type(obj)->tp_name);
+			     Py_TYPE(obj)->tp_name);
 		return NULL;
 	}
 

Modified: python/branches/py3k/Modules/_ctypes/cfield.c
==============================================================================
--- python/branches/py3k/Modules/_ctypes/cfield.c	(original)
+++ python/branches/py3k/Modules/_ctypes/cfield.c	Wed Dec 19 03:45:37 2007
@@ -1349,7 +1349,7 @@
 	data = PyString_AS_STRING(value);
 	if (!data)
 		return NULL;
-	size = strlen(data); /* XXX Why not Py_Size(value)? */
+	size = strlen(data); /* XXX Why not Py_SIZE(value)? */
 	if (size < length) {
 		/* This will copy the leading NUL character
 		 * if there is space for it.

Modified: python/branches/py3k/Modules/_ctypes/stgdict.c
==============================================================================
--- python/branches/py3k/Modules/_ctypes/stgdict.c	(original)
+++ python/branches/py3k/Modules/_ctypes/stgdict.c	Wed Dec 19 03:45:37 2007
@@ -183,7 +183,7 @@
 			Py_DECREF(fieldlist);
 			return -1;
 		}
-		if (Py_Type(fdescr) != &CField_Type) {
+		if (Py_TYPE(fdescr) != &CField_Type) {
 			PyErr_SetString(PyExc_TypeError, "unexpected type");
 			Py_DECREF(fdescr);
 			Py_DECREF(fieldlist);
@@ -206,7 +206,7 @@
 			Py_DECREF(fieldlist);
 			return -1;
 		}
-		assert(Py_Type(new_descr) == &CField_Type);
+		assert(Py_TYPE(new_descr) == &CField_Type);
  		new_descr->size = fdescr->size;
  		new_descr->offset = fdescr->offset + offset;
  		new_descr->index = fdescr->index + index;
@@ -254,7 +254,7 @@
 			Py_DECREF(anon_names);
 			return -1;
 		}
-		assert(Py_Type(descr) == &CField_Type);
+		assert(Py_TYPE(descr) == &CField_Type);
 		descr->anonymous = 1;
 
 		/* descr is in the field descriptor. */

Modified: python/branches/py3k/Modules/_curses_panel.c
==============================================================================
--- python/branches/py3k/Modules/_curses_panel.c	(original)
+++ python/branches/py3k/Modules/_curses_panel.c	Wed Dec 19 03:45:37 2007
@@ -56,7 +56,7 @@
 
 PyTypeObject PyCursesPanel_Type;
 
-#define PyCursesPanel_Check(v)	 (Py_Type(v) == &PyCursesPanel_Type)
+#define PyCursesPanel_Check(v)	 (Py_TYPE(v) == &PyCursesPanel_Type)
 
 /* Some helper functions. The problem is that there's always a window
    associated with a panel. To ensure that Python's GC doesn't pull
@@ -457,7 +457,7 @@
     PyObject *m, *d, *v;
 
     /* Initialize object type */
-    Py_Type(&PyCursesPanel_Type) = &PyType_Type;
+    Py_TYPE(&PyCursesPanel_Type) = &PyType_Type;
 
     import_curses();
 

Modified: python/branches/py3k/Modules/_cursesmodule.c
==============================================================================
--- python/branches/py3k/Modules/_cursesmodule.c	(original)
+++ python/branches/py3k/Modules/_cursesmodule.c	Wed Dec 19 03:45:37 2007
@@ -2709,7 +2709,7 @@
 	static void *PyCurses_API[PyCurses_API_pointers];
 
 	/* Initialize object type */
-	Py_Type(&PyCursesWindow_Type) = &PyType_Type;
+	Py_TYPE(&PyCursesWindow_Type) = &PyType_Type;
 
 	/* Initialize the C API pointer array */
 	PyCurses_API[0] = (void *)&PyCursesWindow_Type;

Modified: python/branches/py3k/Modules/_elementtree.c
==============================================================================
--- python/branches/py3k/Modules/_elementtree.c	(original)
+++ python/branches/py3k/Modules/_elementtree.c	Wed Dec 19 03:45:37 2007
@@ -248,7 +248,7 @@
 
 static PyTypeObject Element_Type;
 
-#define Element_CheckExact(op) (Py_Type(op) == &Element_Type)
+#define Element_CheckExact(op) (Py_TYPE(op) == &Element_Type)
 
 /* -------------------------------------------------------------------- */
 /* element constructor and destructor */
@@ -1174,7 +1174,7 @@
         /* FIXME: support arbitrary sequences? */
         PyErr_Format(
             PyExc_TypeError,
-            "expected list, not \"%.200s\"", Py_Type(item)->tp_name
+            "expected list, not \"%.200s\"", Py_TYPE(item)->tp_name
             );
         return -1;
     }
@@ -1407,7 +1407,7 @@
 
 static PyTypeObject TreeBuilder_Type;
 
-#define TreeBuilder_CheckExact(op) (Py_Type(op) == &TreeBuilder_Type)
+#define TreeBuilder_CheckExact(op) (Py_TYPE(op) == &TreeBuilder_Type)
 
 /* -------------------------------------------------------------------- */
 /* constructor and destructor */
@@ -1574,7 +1574,7 @@
         Py_INCREF(data); self->data = data;
     } else {
         /* more than one item; use a list to collect items */
-        if (PyString_CheckExact(self->data) && Py_Refcnt(self->data) == 1 &&
+        if (PyString_CheckExact(self->data) && Py_REFCNT(self->data) == 1 &&
             PyString_CheckExact(data) && PyString_GET_SIZE(data) == 1) {
             /* expat often generates single character data sections; handle
                the most common case by resizing the existing string... */
@@ -2550,9 +2550,9 @@
 #endif
 
     /* Patch object type */
-    Py_Type(&Element_Type) = Py_Type(&TreeBuilder_Type) = &PyType_Type;
+    Py_TYPE(&Element_Type) = Py_TYPE(&TreeBuilder_Type) = &PyType_Type;
 #if defined(USE_EXPAT)
-    Py_Type(&XMLParser_Type) = &PyType_Type;
+    Py_TYPE(&XMLParser_Type) = &PyType_Type;
 #endif
 
     m = Py_InitModule("_elementtree", _functions);

Modified: python/branches/py3k/Modules/_fileio.c
==============================================================================
--- python/branches/py3k/Modules/_fileio.c	(original)
+++ python/branches/py3k/Modules/_fileio.c	Wed Dec 19 03:45:37 2007
@@ -304,7 +304,7 @@
 		}
 	}
 
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *

Modified: python/branches/py3k/Modules/_functoolsmodule.c
==============================================================================
--- python/branches/py3k/Modules/_functoolsmodule.c	(original)
+++ python/branches/py3k/Modules/_functoolsmodule.c	Wed Dec 19 03:45:37 2007
@@ -81,7 +81,7 @@
 	Py_XDECREF(pto->args);
 	Py_XDECREF(pto->kw);
 	Py_XDECREF(pto->dict);
-	Py_Type(pto)->tp_free(pto);
+	Py_TYPE(pto)->tp_free(pto);
 }
 
 static PyObject *

Modified: python/branches/py3k/Modules/_hashopenssl.c
==============================================================================
--- python/branches/py3k/Modules/_hashopenssl.c	(original)
+++ python/branches/py3k/Modules/_hashopenssl.c	Wed Dec 19 03:45:37 2007
@@ -510,7 +510,7 @@
      * but having some be unsupported.  Only init appropriate
      * constants. */
 
-    Py_Type(&EVPtype) = &PyType_Type;
+    Py_TYPE(&EVPtype) = &PyType_Type;
     if (PyType_Ready(&EVPtype) < 0)
         return;
 

Modified: python/branches/py3k/Modules/_lsprof.c
==============================================================================
--- python/branches/py3k/Modules/_lsprof.c	(original)
+++ python/branches/py3k/Modules/_lsprof.c	Wed Dec 19 03:45:37 2007
@@ -120,7 +120,7 @@
 static PyTypeObject PyProfiler_Type;
 
 #define PyProfiler_Check(op) PyObject_TypeCheck(op, &PyProfiler_Type)
-#define PyProfiler_CheckExact(op) (Py_Type(op) == &PyProfiler_Type)
+#define PyProfiler_CheckExact(op) (Py_TYPE(op) == &PyProfiler_Type)
 
 /*** External Timers ***/
 
@@ -207,7 +207,7 @@
 		PyObject *self = fn->m_self;
 		PyObject *name = PyUnicode_FromString(fn->m_ml->ml_name);
 		if (name != NULL) {
-			PyObject *mo = _PyType_Lookup(Py_Type(self), name);
+			PyObject *mo = _PyType_Lookup(Py_TYPE(self), name);
 			Py_XINCREF(mo);
 			Py_DECREF(name);
 			if (mo != NULL) {
@@ -756,7 +756,7 @@
 	flush_unmatched(op);
 	clearEntries(op);
 	Py_XDECREF(op->externalTimer);
-	Py_Type(op)->tp_free(op);
+	Py_TYPE(op)->tp_free(op);
 }
 
 static int

Modified: python/branches/py3k/Modules/_randommodule.c
==============================================================================
--- python/branches/py3k/Modules/_randommodule.c	(original)
+++ python/branches/py3k/Modules/_randommodule.c	Wed Dec 19 03:45:37 2007
@@ -84,7 +84,7 @@
 
 static PyTypeObject Random_Type;
 
-#define RandomObject_Check(v)	   (Py_Type(v) == &Random_Type)
+#define RandomObject_Check(v)	   (Py_TYPE(v) == &Random_Type)
 
 
 /* Random methods */
@@ -405,7 +405,7 @@
 	if (!PyLong_Check(n)) {
 		PyErr_Format(PyExc_TypeError, "jumpahead requires an "
 			     "integer, not '%s'",
-			     Py_Type(n)->tp_name);
+			     Py_TYPE(n)->tp_name);
 		return NULL;
 	}
 

Modified: python/branches/py3k/Modules/_sqlite/cache.c
==============================================================================
--- python/branches/py3k/Modules/_sqlite/cache.c	(original)
+++ python/branches/py3k/Modules/_sqlite/cache.c	Wed Dec 19 03:45:37 2007
@@ -51,7 +51,7 @@
     Py_DECREF(self->key);
     Py_DECREF(self->data);
 
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs)
@@ -109,7 +109,7 @@
     }
     Py_DECREF(self->mapping);
 
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* args)

Modified: python/branches/py3k/Modules/_sqlite/connection.c
==============================================================================
--- python/branches/py3k/Modules/_sqlite/connection.c	(original)
+++ python/branches/py3k/Modules/_sqlite/connection.c	Wed Dec 19 03:45:37 2007
@@ -205,7 +205,7 @@
     Py_XDECREF(self->collations);
     Py_XDECREF(self->statements);
 
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 PyObject* pysqlite_connection_cursor(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)

Modified: python/branches/py3k/Modules/_sqlite/cursor.c
==============================================================================
--- python/branches/py3k/Modules/_sqlite/cursor.c	(original)
+++ python/branches/py3k/Modules/_sqlite/cursor.c	Wed Dec 19 03:45:37 2007
@@ -134,7 +134,7 @@
     Py_XDECREF(self->row_factory);
     Py_XDECREF(self->next_row);
 
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 PyObject* _pysqlite_get_converter(PyObject* key)

Modified: python/branches/py3k/Modules/_sqlite/prepare_protocol.c
==============================================================================
--- python/branches/py3k/Modules/_sqlite/prepare_protocol.c	(original)
+++ python/branches/py3k/Modules/_sqlite/prepare_protocol.c	Wed Dec 19 03:45:37 2007
@@ -30,7 +30,7 @@
 
 void pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol* self)
 {
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 PyTypeObject pysqlite_PrepareProtocolType= {
@@ -78,6 +78,6 @@
 extern int pysqlite_prepare_protocol_setup_types(void)
 {
     pysqlite_PrepareProtocolType.tp_new = PyType_GenericNew;
-    Py_Type(&pysqlite_PrepareProtocolType)= &PyType_Type;
+    Py_TYPE(&pysqlite_PrepareProtocolType)= &PyType_Type;
     return PyType_Ready(&pysqlite_PrepareProtocolType);
 }

Modified: python/branches/py3k/Modules/_sqlite/row.c
==============================================================================
--- python/branches/py3k/Modules/_sqlite/row.c	(original)
+++ python/branches/py3k/Modules/_sqlite/row.c	Wed Dec 19 03:45:37 2007
@@ -30,7 +30,7 @@
     Py_XDECREF(self->data);
     Py_XDECREF(self->description);
 
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 int pysqlite_row_init(pysqlite_Row* self, PyObject* args, PyObject* kwargs)

Modified: python/branches/py3k/Modules/_sqlite/statement.c
==============================================================================
--- python/branches/py3k/Modules/_sqlite/statement.c	(original)
+++ python/branches/py3k/Modules/_sqlite/statement.c	Wed Dec 19 03:45:37 2007
@@ -307,7 +307,7 @@
         PyObject_ClearWeakRefs((PyObject*)self);
     }
 
-    Py_Type(self)->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 /*

Modified: python/branches/py3k/Modules/_sre.c
==============================================================================
--- python/branches/py3k/Modules/_sre.c	(original)
+++ python/branches/py3k/Modules/_sre.c	Wed Dec 19 03:45:37 2007
@@ -1685,7 +1685,7 @@
 
     /* get pointer to string buffer */
     view.len = -1;
-    buffer = Py_Type(string)->tp_as_buffer;
+    buffer = Py_TYPE(string)->tp_as_buffer;
     if (!buffer || !buffer->bf_getbuffer || 
         (*buffer->bf_getbuffer)(string, &view, PyBUF_SIMPLE) < 0) {
             PyErr_SetString(PyExc_TypeError, "expected string or buffer");

Modified: python/branches/py3k/Modules/_ssl.c
==============================================================================
--- python/branches/py3k/Modules/_ssl.c	(original)
+++ python/branches/py3k/Modules/_ssl.c	Wed Dec 19 03:45:37 2007
@@ -127,7 +127,7 @@
 static PyObject *PySSL_peercert(PySSLObject *self, PyObject *args);
 static PyObject *PySSL_cipher(PySSLObject *self);
 
-#define PySSLObject_Check(v)	(Py_Type(v) == &PySSL_Type)
+#define PySSLObject_Check(v)	(Py_TYPE(v) == &PySSL_Type)
 
 typedef enum {
 	SOCKET_IS_NONBLOCKING,
@@ -1451,7 +1451,7 @@
     if (!PyUnicode_Check(arg))
 	return PyErr_Format(PyExc_TypeError,
 			    "RAND_egd() expected string, found %s",
-			    Py_Type(arg)->tp_name);
+			    Py_TYPE(arg)->tp_name);
     bytes = RAND_egd(PyUnicode_AsString(arg));
     if (bytes == -1) {
 	PyErr_SetString(PySSLErrorObject,
@@ -1568,7 +1568,7 @@
 {
 	PyObject *m, *d;
 
-	Py_Type(&PySSL_Type) = &PyType_Type;
+	Py_TYPE(&PySSL_Type) = &PyType_Type;
 
 	m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
 	if (m == NULL)

Modified: python/branches/py3k/Modules/_struct.c
==============================================================================
--- python/branches/py3k/Modules/_struct.c	(original)
+++ python/branches/py3k/Modules/_struct.c	Wed Dec 19 03:45:37 2007
@@ -67,7 +67,7 @@
 
 
 #define PyStruct_Check(op) PyObject_TypeCheck(op, &PyStructType)
-#define PyStruct_CheckExact(op) (Py_Type(op) == &PyStructType)
+#define PyStruct_CheckExact(op) (Py_TYPE(op) == &PyStructType)
 
 
 /* Exception */
@@ -126,7 +126,7 @@
 		Py_INCREF(v);
 		return v;
 	}
-	m = Py_Type(v)->tp_as_number;
+	m = Py_TYPE(v)->tp_as_number;
 	if (m != NULL && m->nb_long != NULL) {
 		v = m->nb_long(v);
 		if (v == NULL)
@@ -1485,7 +1485,7 @@
 		PyMem_FREE(s->s_codes);
 	}
 	Py_XDECREF(s->s_format);
-	Py_Type(s)->tp_free((PyObject *)s);
+	Py_TYPE(s)->tp_free((PyObject *)s);
 }
 
 static PyObject *
@@ -1870,7 +1870,7 @@
 	if (m == NULL)
 		return;
 
-	Py_Type(&PyStructType) = &PyType_Type;
+	Py_TYPE(&PyStructType) = &PyType_Type;
 	if (PyType_Ready(&PyStructType) < 0)
 		return;
 

Modified: python/branches/py3k/Modules/_testcapimodule.c
==============================================================================
--- python/branches/py3k/Modules/_testcapimodule.c	(original)
+++ python/branches/py3k/Modules/_testcapimodule.c	Wed Dec 19 03:45:37 2007
@@ -1057,7 +1057,7 @@
 	if (m == NULL)
 		return;
 
-	Py_Type(&test_structmembersType)=&PyType_Type;
+	Py_TYPE(&test_structmembersType)=&PyType_Type;
 	Py_INCREF(&test_structmembersType);
 	PyModule_AddObject(m, "test_structmembersType", (PyObject *)&test_structmembersType);
 

Modified: python/branches/py3k/Modules/_tkinter.c
==============================================================================
--- python/branches/py3k/Modules/_tkinter.c	(original)
+++ python/branches/py3k/Modules/_tkinter.c	Wed Dec 19 03:45:37 2007
@@ -262,12 +262,12 @@
 	Tcl_ObjType *StringType;
 } TkappObject;
 
-#define Tkapp_Check(v) (Py_Type(v) == &Tkapp_Type)
+#define Tkapp_Check(v) (Py_TYPE(v) == &Tkapp_Type)
 #define Tkapp_Interp(v) (((TkappObject *) (v))->interp)
 #define Tkapp_Result(v) Tcl_GetStringResult(Tkapp_Interp(v))
 
 #define DEBUG_REFCNT(v) (printf("DEBUG: id=%p, refcnt=%i\n", \
-(void *) v, Py_Refcnt(v)))
+(void *) v, Py_REFCNT(v)))
 
 
 
@@ -3016,7 +3016,7 @@
 {
 	PyObject *m, *d;
 
-	Py_Type(&Tkapp_Type) = &PyType_Type;
+	Py_TYPE(&Tkapp_Type) = &PyType_Type;
 
 #ifdef WITH_THREAD
 	tcl_lock = PyThread_allocate_lock();
@@ -3044,10 +3044,10 @@
 
 	PyDict_SetItemString(d, "TkappType", (PyObject *)&Tkapp_Type);
 
-	Py_Type(&Tktt_Type) = &PyType_Type;
+	Py_TYPE(&Tktt_Type) = &PyType_Type;
 	PyDict_SetItemString(d, "TkttType", (PyObject *)&Tktt_Type);
 
-	Py_Type(&PyTclObject_Type) = &PyType_Type;
+	Py_TYPE(&PyTclObject_Type) = &PyType_Type;
 	PyDict_SetItemString(d, "Tcl_Obj", (PyObject *)&PyTclObject_Type);
 
 #ifdef TK_AQUA

Modified: python/branches/py3k/Modules/_weakref.c
==============================================================================
--- python/branches/py3k/Modules/_weakref.c	(original)
+++ python/branches/py3k/Modules/_weakref.c	Wed Dec 19 03:45:37 2007
@@ -14,7 +14,7 @@
 {
     PyObject *result = NULL;
 
-    if (PyType_SUPPORTS_WEAKREFS(Py_Type(object))) {
+    if (PyType_SUPPORTS_WEAKREFS(Py_TYPE(object))) {
         PyWeakReference **list = GET_WEAKREFS_LISTPTR(object);
 
         result = PyLong_FromSsize_t(_PyWeakref_GetWeakrefCount(*list));
@@ -35,7 +35,7 @@
 {
     PyObject *result = NULL;
 
-    if (PyType_SUPPORTS_WEAKREFS(Py_Type(object))) {
+    if (PyType_SUPPORTS_WEAKREFS(Py_TYPE(object))) {
         PyWeakReference **list = GET_WEAKREFS_LISTPTR(object);
         Py_ssize_t count = _PyWeakref_GetWeakrefCount(*list);
 

Modified: python/branches/py3k/Modules/arraymodule.c
==============================================================================
--- python/branches/py3k/Modules/arraymodule.c	(original)
+++ python/branches/py3k/Modules/arraymodule.c	Wed Dec 19 03:45:37 2007
@@ -41,7 +41,7 @@
 static PyTypeObject Arraytype;
 
 #define array_Check(op) PyObject_TypeCheck(op, &Arraytype)
-#define array_CheckExact(op) (Py_Type(op) == &Arraytype)
+#define array_CheckExact(op) (Py_TYPE(op) == &Arraytype)
 
 static int
 array_resize(arrayobject *self, Py_ssize_t newsize)
@@ -55,9 +55,9 @@
 	*/
 
 	if (self->allocated >= newsize &&
-	    Py_Size(self) < newsize + 16 &&
+	    Py_SIZE(self) < newsize + 16 &&
 	    self->ob_item != NULL) {
-		Py_Size(self) = newsize;
+		Py_SIZE(self) = newsize;
 		return 0;
 	}
 
@@ -79,7 +79,7 @@
 	 * memory critical.
 	 */
 
-	_new_size = (newsize >> 4) + (Py_Size(self) < 8 ? 3 : 7) + newsize;
+	_new_size = (newsize >> 4) + (Py_SIZE(self) < 8 ? 3 : 7) + newsize;
 	items = self->ob_item;
 	/* XXX The following multiplication and division does not optimize away 
 	   like it does for lists since the size is not known at compile time */
@@ -92,7 +92,7 @@
 		return -1;
 	}
 	self->ob_item = items;
-	Py_Size(self) = newsize;
+	Py_SIZE(self) = newsize;
 	self->allocated = _new_size;
 	return 0;
 }
@@ -421,7 +421,7 @@
 	if (op == NULL) {
 		return NULL;
 	}
-	Py_Size(op) = size;
+	Py_SIZE(op) = size;
 	if (size <= 0) {
 		op->ob_item = NULL;
 	}
@@ -445,7 +445,7 @@
 	register arrayobject *ap;
 	assert(array_Check(op));
 	ap = (arrayobject *)op;
-	assert(i>=0 && i<Py_Size(ap));
+	assert(i>=0 && i<Py_SIZE(ap));
 	return (*ap->ob_descr->getitem)(ap, i);
 }
 
@@ -453,7 +453,7 @@
 ins1(arrayobject *self, Py_ssize_t where, PyObject *v)
 {
 	char *items;
-	Py_ssize_t n = Py_Size(self);
+	Py_ssize_t n = Py_SIZE(self);
 	if (v == NULL) {
 		PyErr_BadInternalCall();
 		return -1;
@@ -488,7 +488,7 @@
 		PyObject_ClearWeakRefs((PyObject *) op);
 	if (op->ob_item != NULL)
 		PyMem_DEL(op->ob_item);
-	Py_Type(op)->tp_free((PyObject *)op);
+	Py_TYPE(op)->tp_free((PyObject *)op);
 }
 
 static PyObject *
@@ -508,7 +508,7 @@
 	va = (arrayobject *)v;
 	wa = (arrayobject *)w;
 
-	if (Py_Size(va) != Py_Size(wa) && (op == Py_EQ || op == Py_NE)) {
+	if (Py_SIZE(va) != Py_SIZE(wa) && (op == Py_EQ || op == Py_NE)) {
 		/* Shortcut: if the lengths differ, the arrays differ */
 		if (op == Py_EQ)
 			res = Py_False;
@@ -520,7 +520,7 @@
 
 	/* Search for the first index where items are different */
 	k = 1;
-	for (i = 0; i < Py_Size(va) && i < Py_Size(wa); i++) {
+	for (i = 0; i < Py_SIZE(va) && i < Py_SIZE(wa); i++) {
 		vi = getarrayitem(v, i);
 		wi = getarrayitem(w, i);
 		if (vi == NULL || wi == NULL) {
@@ -539,8 +539,8 @@
 
 	if (k) {
 		/* No more items to compare -- compare sizes */
-		Py_ssize_t vs = Py_Size(va);
-		Py_ssize_t ws = Py_Size(wa);
+		Py_ssize_t vs = Py_SIZE(va);
+		Py_ssize_t ws = Py_SIZE(wa);
 		int cmp;
 		switch (op) {
 		case Py_LT: cmp = vs <  ws; break;
@@ -580,13 +580,13 @@
 static Py_ssize_t
 array_length(arrayobject *a)
 {
-	return Py_Size(a);
+	return Py_SIZE(a);
 }
 
 static PyObject *
 array_item(arrayobject *a, Py_ssize_t i)
 {
-	if (i < 0 || i >= Py_Size(a)) {
+	if (i < 0 || i >= Py_SIZE(a)) {
 		PyErr_SetString(PyExc_IndexError, "array index out of range");
 		return NULL;
 	}
@@ -599,14 +599,14 @@
 	arrayobject *np;
 	if (ilow < 0)
 		ilow = 0;
-	else if (ilow > Py_Size(a))
-		ilow = Py_Size(a);
+	else if (ilow > Py_SIZE(a))
+		ilow = Py_SIZE(a);
 	if (ihigh < 0)
 		ihigh = 0;
 	if (ihigh < ilow)
 		ihigh = ilow;
-	else if (ihigh > Py_Size(a))
-		ihigh = Py_Size(a);
+	else if (ihigh > Py_SIZE(a))
+		ihigh = Py_SIZE(a);
 	np = (arrayobject *) newarrayobject(&Arraytype, ihigh - ilow, a->ob_descr);
 	if (np == NULL)
 		return NULL;
@@ -618,7 +618,7 @@
 static PyObject *
 array_copy(arrayobject *a, PyObject *unused)
 {
-	return array_slice(a, 0, Py_Size(a));
+	return array_slice(a, 0, Py_SIZE(a));
 }
 
 PyDoc_STRVAR(copy_doc,
@@ -634,7 +634,7 @@
 	if (!array_Check(bb)) {
 		PyErr_Format(PyExc_TypeError,
 		     "can only append array (not \"%.200s\") to array",
-			     Py_Type(bb)->tp_name);
+			     Py_TYPE(bb)->tp_name);
 		return NULL;
 	}
 #define b ((arrayobject *)bb)
@@ -642,14 +642,14 @@
 		PyErr_BadArgument();
 		return NULL;
 	}
-	size = Py_Size(a) + Py_Size(b);
+	size = Py_SIZE(a) + Py_SIZE(b);
 	np = (arrayobject *) newarrayobject(&Arraytype, size, a->ob_descr);
 	if (np == NULL) {
 		return NULL;
 	}
-	memcpy(np->ob_item, a->ob_item, Py_Size(a)*a->ob_descr->itemsize);
-	memcpy(np->ob_item + Py_Size(a)*a->ob_descr->itemsize,
-	       b->ob_item, Py_Size(b)*b->ob_descr->itemsize);
+	memcpy(np->ob_item, a->ob_item, Py_SIZE(a)*a->ob_descr->itemsize);
+	memcpy(np->ob_item + Py_SIZE(a)*a->ob_descr->itemsize,
+	       b->ob_item, Py_SIZE(b)*b->ob_descr->itemsize);
 	return (PyObject *)np;
 #undef b
 }
@@ -664,12 +664,12 @@
 	Py_ssize_t nbytes;
 	if (n < 0)
 		n = 0;
-	size = Py_Size(a) * n;
+	size = Py_SIZE(a) * n;
 	np = (arrayobject *) newarrayobject(&Arraytype, size, a->ob_descr);
 	if (np == NULL)
 		return NULL;
 	p = np->ob_item;
-	nbytes = Py_Size(a) * a->ob_descr->itemsize;
+	nbytes = Py_SIZE(a) * a->ob_descr->itemsize;
 	for (i = 0; i < n; i++) {
 		memcpy(p, a->ob_item, nbytes);
 		p += nbytes;
@@ -687,7 +687,7 @@
 	if (v == NULL)
 		n = 0;
 	else if (array_Check(v)) {
-		n = Py_Size(b);
+		n = Py_SIZE(b);
 		if (a == b) {
 			/* Special case "a[i:j] = a" -- copy b first */
 			int ret;
@@ -706,44 +706,44 @@
 	else {
 		PyErr_Format(PyExc_TypeError,
 	     "can only assign array (not \"%.200s\") to array slice",
-			     Py_Type(v)->tp_name);
+			     Py_TYPE(v)->tp_name);
 		return -1;
 	}
 	if (ilow < 0)
 		ilow = 0;
-	else if (ilow > Py_Size(a))
-		ilow = Py_Size(a);
+	else if (ilow > Py_SIZE(a))
+		ilow = Py_SIZE(a);
 	if (ihigh < 0)
 		ihigh = 0;
 	if (ihigh < ilow)
 		ihigh = ilow;
-	else if (ihigh > Py_Size(a))
-		ihigh = Py_Size(a);
+	else if (ihigh > Py_SIZE(a))
+		ihigh = Py_SIZE(a);
 	item = a->ob_item;
 	d = n - (ihigh-ilow);
 	if (d < 0) { /* Delete -d items */
 		memmove(item + (ihigh+d)*a->ob_descr->itemsize,
 			item + ihigh*a->ob_descr->itemsize,
-			(Py_Size(a)-ihigh)*a->ob_descr->itemsize);
-		Py_Size(a) += d;
-		PyMem_RESIZE(item, char, Py_Size(a)*a->ob_descr->itemsize);
+			(Py_SIZE(a)-ihigh)*a->ob_descr->itemsize);
+		Py_SIZE(a) += d;
+		PyMem_RESIZE(item, char, Py_SIZE(a)*a->ob_descr->itemsize);
 						/* Can't fail */
 		a->ob_item = item;
-		a->allocated = Py_Size(a);
+		a->allocated = Py_SIZE(a);
 	}
 	else if (d > 0) { /* Insert d items */
 		PyMem_RESIZE(item, char,
-			     (Py_Size(a) + d)*a->ob_descr->itemsize);
+			     (Py_SIZE(a) + d)*a->ob_descr->itemsize);
 		if (item == NULL) {
 			PyErr_NoMemory();
 			return -1;
 		}
 		memmove(item + (ihigh+d)*a->ob_descr->itemsize,
 			item + ihigh*a->ob_descr->itemsize,
-			(Py_Size(a)-ihigh)*a->ob_descr->itemsize);
+			(Py_SIZE(a)-ihigh)*a->ob_descr->itemsize);
 		a->ob_item = item;
-		Py_Size(a) += d;
-		a->allocated = Py_Size(a);
+		Py_SIZE(a) += d;
+		a->allocated = Py_SIZE(a);
 	}
 	if (n > 0)
 		memcpy(item + ilow*a->ob_descr->itemsize, b->ob_item,
@@ -755,7 +755,7 @@
 static int
 array_ass_item(arrayobject *a, Py_ssize_t i, PyObject *v)
 {
-	if (i < 0 || i >= Py_Size(a)) {
+	if (i < 0 || i >= Py_SIZE(a)) {
 		PyErr_SetString(PyExc_IndexError,
 			         "array assignment index out of range");
 		return -1;
@@ -782,7 +782,7 @@
 		return -1;
 
 	while ((v = PyIter_Next(it)) != NULL) {
-		if (ins1(self, (int) Py_Size(self), v) != 0) {
+		if (ins1(self, (int) Py_SIZE(self), v) != 0) {
 			Py_DECREF(v);
 			Py_DECREF(it);
 			return -1;
@@ -808,16 +808,16 @@
 			     "can only extend with array of same kind");
 		return -1;
 	}
-	size = Py_Size(self) + Py_Size(b);
+	size = Py_SIZE(self) + Py_SIZE(b);
         PyMem_RESIZE(self->ob_item, char, size*self->ob_descr->itemsize);
         if (self->ob_item == NULL) {
                 PyObject_Del(self);
                 PyErr_NoMemory();
 		return -1;
         }
-	memcpy(self->ob_item + Py_Size(self)*self->ob_descr->itemsize,
-               b->ob_item, Py_Size(b)*b->ob_descr->itemsize);
-	Py_Size(self) = size;
+	memcpy(self->ob_item + Py_SIZE(self)*self->ob_descr->itemsize,
+               b->ob_item, Py_SIZE(b)*b->ob_descr->itemsize);
+	Py_SIZE(self) = size;
 	self->allocated = size;
 
 	return 0;
@@ -830,7 +830,7 @@
 	if (!array_Check(bb)) {
 		PyErr_Format(PyExc_TypeError,
 			"can only extend array with array (not \"%.200s\")",
-			Py_Type(bb)->tp_name);
+			Py_TYPE(bb)->tp_name);
 		return NULL;
 	}
 	if (array_do_extend(self, bb) == -1)
@@ -845,15 +845,15 @@
 	char *items, *p;
 	Py_ssize_t size, i;
 
-	if (Py_Size(self) > 0) {
+	if (Py_SIZE(self) > 0) {
 		if (n < 0)
 			n = 0;
 		items = self->ob_item;
-		size = Py_Size(self) * self->ob_descr->itemsize;
+		size = Py_SIZE(self) * self->ob_descr->itemsize;
 		if (n == 0) {
 			PyMem_FREE(items);
 			self->ob_item = NULL;
-			Py_Size(self) = 0;
+			Py_SIZE(self) = 0;
 			self->allocated = 0;
 		}
 		else {
@@ -866,8 +866,8 @@
 				memcpy(p, items, size);
 			}
 			self->ob_item = items;
-			Py_Size(self) *= n;
-			self->allocated = Py_Size(self);
+			Py_SIZE(self) *= n;
+			self->allocated = Py_SIZE(self);
 		}
 	}
 	Py_INCREF(self);
@@ -890,7 +890,7 @@
 	Py_ssize_t count = 0;
 	Py_ssize_t i;
 
-	for (i = 0; i < Py_Size(self); i++) {
+	for (i = 0; i < Py_SIZE(self); i++) {
 		PyObject *selfi = getarrayitem((PyObject *)self, i);
 		int cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
 		Py_DECREF(selfi);
@@ -912,7 +912,7 @@
 {
 	Py_ssize_t i;
 
-	for (i = 0; i < Py_Size(self); i++) {
+	for (i = 0; i < Py_SIZE(self); i++) {
 		PyObject *selfi = getarrayitem((PyObject *)self, i);
 		int cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
 		Py_DECREF(selfi);
@@ -937,7 +937,7 @@
 	Py_ssize_t i;
 	int cmp;
 
-	for (i = 0, cmp = 0 ; cmp == 0 && i < Py_Size(self); i++) {
+	for (i = 0, cmp = 0 ; cmp == 0 && i < Py_SIZE(self); i++) {
 		PyObject *selfi = getarrayitem((PyObject *)self, i);
 		cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
 		Py_DECREF(selfi);
@@ -950,7 +950,7 @@
 {
 	int i;
 
-	for (i = 0; i < Py_Size(self); i++) {
+	for (i = 0; i < Py_SIZE(self); i++) {
 		PyObject *selfi = getarrayitem((PyObject *)self,i);
 		int cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
 		Py_DECREF(selfi);
@@ -980,14 +980,14 @@
 	PyObject *v;
 	if (!PyArg_ParseTuple(args, "|n:pop", &i))
 		return NULL;
-	if (Py_Size(self) == 0) {
+	if (Py_SIZE(self) == 0) {
 		/* Special-case most common failure cause */
 		PyErr_SetString(PyExc_IndexError, "pop from empty array");
 		return NULL;
 	}
 	if (i < 0)
-		i += Py_Size(self);
-	if (i < 0 || i >= Py_Size(self)) {
+		i += Py_SIZE(self);
+	if (i < 0 || i >= Py_SIZE(self)) {
 		PyErr_SetString(PyExc_IndexError, "pop index out of range");
 		return NULL;
 	}
@@ -1043,7 +1043,7 @@
 		return NULL;
 
 	PyTuple_SET_ITEM(retval, 0, PyLong_FromVoidPtr(self->ob_item));
-	PyTuple_SET_ITEM(retval, 1, PyLong_FromLong((long)(Py_Size(self))));
+	PyTuple_SET_ITEM(retval, 1, PyLong_FromLong((long)(Py_SIZE(self))));
 
 	return retval;
 }
@@ -1060,7 +1060,7 @@
 static PyObject *
 array_append(arrayobject *self, PyObject *v)
 {
-	return ins(self, (int) Py_Size(self), v);
+	return ins(self, (int) Py_SIZE(self), v);
 }
 
 PyDoc_STRVAR(append_doc,
@@ -1079,14 +1079,14 @@
 	case 1:
 		break;
 	case 2:
-		for (p = self->ob_item, i = Py_Size(self); --i >= 0; p += 2) {
+		for (p = self->ob_item, i = Py_SIZE(self); --i >= 0; p += 2) {
 			char p0 = p[0];
 			p[0] = p[1];
 			p[1] = p0;
 		}
 		break;
 	case 4:
-		for (p = self->ob_item, i = Py_Size(self); --i >= 0; p += 4) {
+		for (p = self->ob_item, i = Py_SIZE(self); --i >= 0; p += 4) {
 			char p0 = p[0];
 			char p1 = p[1];
 			p[0] = p[3];
@@ -1096,7 +1096,7 @@
 		}
 		break;
 	case 8:
-		for (p = self->ob_item, i = Py_Size(self); --i >= 0; p += 8) {
+		for (p = self->ob_item, i = Py_SIZE(self); --i >= 0; p += 8) {
 			char p0 = p[0];
 			char p1 = p[1];
 			char p2 = p[2];
@@ -1137,16 +1137,16 @@
 		dict = Py_None;
 		Py_INCREF(dict);
 	}
-	if (Py_Size(array) > 0) {
+	if (Py_SIZE(array) > 0) {
 		result = Py_BuildValue("O(cy#)O", 
-			Py_Type(array), 
+			Py_TYPE(array), 
 			array->ob_descr->typecode,
 			array->ob_item,
-			Py_Size(array) * array->ob_descr->itemsize,
+			Py_SIZE(array) * array->ob_descr->itemsize,
 			dict);
 	} else {
 		result = Py_BuildValue("O(c)O", 
-			Py_Type(array), 
+			Py_TYPE(array), 
 			array->ob_descr->typecode,
 			dict);
 	}
@@ -1165,9 +1165,9 @@
 	char tmp[256];	/* 8 is probably enough -- but why skimp */
 	assert((size_t)itemsize <= sizeof(tmp));
 
-	if (Py_Size(self) > 1) {
+	if (Py_SIZE(self) > 1) {
 		for (p = self->ob_item,
-		     q = self->ob_item + (Py_Size(self) - 1)*itemsize;
+		     q = self->ob_item + (Py_SIZE(self) - 1)*itemsize;
 		     p < q;
 		     p += itemsize, q -= itemsize) {
 			/* memory areas guaranteed disjoint, so memcpy
@@ -1247,14 +1247,14 @@
 static PyObject *
 array_tofile(arrayobject *self, PyObject *f)
 {
-	Py_ssize_t nbytes = Py_Size(self) * self->ob_descr->itemsize;
+	Py_ssize_t nbytes = Py_SIZE(self) * self->ob_descr->itemsize;
 	/* Write 64K blocks at a time */
 	/* XXX Make the block size settable */
 	int BLOCKSIZE = 64*1024;
 	Py_ssize_t nblocks = (nbytes + BLOCKSIZE - 1) / BLOCKSIZE;
 	Py_ssize_t i;
 
-        if (Py_Size(self) == 0)
+        if (Py_SIZE(self) == 0)
 		goto done;
 
 	for (i = 0; i < nblocks; i++) {
@@ -1299,23 +1299,23 @@
 	if (n > 0) {
 		char *item = self->ob_item;
 		Py_ssize_t i;
-		PyMem_RESIZE(item, char, (Py_Size(self) + n) * itemsize);
+		PyMem_RESIZE(item, char, (Py_SIZE(self) + n) * itemsize);
 		if (item == NULL) {
 			PyErr_NoMemory();
 			return NULL;
 		}
 		self->ob_item = item;
-		Py_Size(self) += n;
-		self->allocated = Py_Size(self);
+		Py_SIZE(self) += n;
+		self->allocated = Py_SIZE(self);
 		for (i = 0; i < n; i++) {
 			PyObject *v = PyList_GetItem(list, i);
 			if ((*self->ob_descr->setitem)(self,
-					Py_Size(self) - n + i, v) != 0) {
-				Py_Size(self) -= n;
+					Py_SIZE(self) - n + i, v) != 0) {
+				Py_SIZE(self) -= n;
 				PyMem_RESIZE(item, char,
-					          Py_Size(self) * itemsize);
+					          Py_SIZE(self) * itemsize);
 				self->ob_item = item;
-				self->allocated = Py_Size(self);
+				self->allocated = Py_SIZE(self);
 				return NULL;
 			}
 		}
@@ -1332,12 +1332,12 @@
 static PyObject *
 array_tolist(arrayobject *self, PyObject *unused)
 {
-	PyObject *list = PyList_New(Py_Size(self));
+	PyObject *list = PyList_New(Py_SIZE(self));
 	Py_ssize_t i;
 
 	if (list == NULL)
 		return NULL;
-	for (i = 0; i < Py_Size(self); i++) {
+	for (i = 0; i < Py_SIZE(self); i++) {
 		PyObject *v = getarrayitem((PyObject *)self, i);
 		if (v == NULL) {
 			Py_DECREF(list);
@@ -1370,15 +1370,15 @@
 	n = n / itemsize;
 	if (n > 0) {
 		char *item = self->ob_item;
-		PyMem_RESIZE(item, char, (Py_Size(self) + n) * itemsize);
+		PyMem_RESIZE(item, char, (Py_SIZE(self) + n) * itemsize);
 		if (item == NULL) {
 			PyErr_NoMemory();
 			return NULL;
 		}
 		self->ob_item = item;
-		Py_Size(self) += n;
-		self->allocated = Py_Size(self);
-		memcpy(item + (Py_Size(self) - n) * itemsize,
+		Py_SIZE(self) += n;
+		self->allocated = Py_SIZE(self);
+		memcpy(item + (Py_SIZE(self) - n) * itemsize,
 		       str, itemsize*n);
 	}
 	Py_INCREF(Py_None);
@@ -1396,7 +1396,7 @@
 array_tostring(arrayobject *self, PyObject *unused)
 {
 	return PyString_FromStringAndSize(self->ob_item,
-                                         Py_Size(self) * self->ob_descr->itemsize);
+                                         Py_SIZE(self) * self->ob_descr->itemsize);
 }
 
 PyDoc_STRVAR(tostring_doc,
@@ -1425,15 +1425,15 @@
 	}
 	if (n > 0) {
 		Py_UNICODE *item = (Py_UNICODE *) self->ob_item;
-		PyMem_RESIZE(item, Py_UNICODE, Py_Size(self) + n);
+		PyMem_RESIZE(item, Py_UNICODE, Py_SIZE(self) + n);
 		if (item == NULL) {
 			PyErr_NoMemory();
 			return NULL;
 		}
 		self->ob_item = (char *) item;
-		Py_Size(self) += n;
-		self->allocated = Py_Size(self);
-		memcpy(item + Py_Size(self) - n,
+		Py_SIZE(self) += n;
+		self->allocated = Py_SIZE(self);
+		memcpy(item + Py_SIZE(self) - n,
 		       ustr, n * sizeof(Py_UNICODE));
 	}
 
@@ -1460,7 +1460,7 @@
 		     "tounicode() may only be called on unicode type arrays");
 		return NULL;
 	}
-	return PyUnicode_FromUnicode((Py_UNICODE *) self->ob_item, Py_Size(self));
+	return PyUnicode_FromUnicode((Py_UNICODE *) self->ob_item, Py_SIZE(self));
 }
 
 PyDoc_STRVAR(tounicode_doc,
@@ -1553,7 +1553,7 @@
 	PyObject *s, *v = NULL;
 	Py_ssize_t len;
 
-	len = Py_Size(a);
+	len = Py_SIZE(a);
 	typecode = a->ob_descr->typecode;
 	if (len == 0) {
 		return PyUnicode_FromFormat("array('%c')", typecode);
@@ -1577,7 +1577,7 @@
 			return NULL;
 		}
 		if (i < 0)
-			i += Py_Size(self);
+			i += Py_SIZE(self);
 		return array_item(self, i);
 	}
 	else if (PySlice_Check(item)) {
@@ -1586,7 +1586,7 @@
 		arrayobject* ar;
 		int itemsize = self->ob_descr->itemsize;
 
-		if (PySlice_GetIndicesEx((PySliceObject*)item, Py_Size(self),
+		if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
 				 &start, &stop, &step, &slicelength) < 0) {
 			return NULL;
 		}
@@ -1640,8 +1640,8 @@
 		if (i == -1 && PyErr_Occurred())
 			return -1;
 		if (i < 0)
-			i += Py_Size(self);
-		if (i < 0 || i >= Py_Size(self)) {
+			i += Py_SIZE(self);
+		if (i < 0 || i >= Py_SIZE(self)) {
 			PyErr_SetString(PyExc_IndexError,
 				"array assignment index out of range");
 			return -1;
@@ -1658,7 +1658,7 @@
 	}
 	else if (PySlice_Check(item)) {
 		if (PySlice_GetIndicesEx((PySliceObject *)item,
-					 Py_Size(self), &start, &stop,
+					 Py_SIZE(self), &start, &stop,
 					 &step, &slicelength) < 0) {
 			return -1;
 		}
@@ -1674,7 +1674,7 @@
 	}
 	else if (array_Check(value)) {
 		other = (arrayobject *)value;
-		needed = Py_Size(other);
+		needed = Py_SIZE(other);
 		if (self == other) {
 			/* Special case "self[i:j] = self" -- copy self first */
 			int ret;
@@ -1693,7 +1693,7 @@
 	else {
 		PyErr_Format(PyExc_TypeError,
 	     "can only assign array (not \"%.200s\") to array slice",
-			     Py_Type(value)->tp_name);
+			     Py_TYPE(value)->tp_name);
 		return -1;
 	}
 	itemsize = self->ob_descr->itemsize;
@@ -1705,18 +1705,18 @@
 		if (slicelength > needed) {
 			memmove(self->ob_item + (start + needed) * itemsize,
 				self->ob_item + stop * itemsize,
-				(Py_Size(self) - stop) * itemsize);
-			if (array_resize(self, Py_Size(self) +
+				(Py_SIZE(self) - stop) * itemsize);
+			if (array_resize(self, Py_SIZE(self) +
 					 needed - slicelength) < 0)
 				return -1;
 		}
 		else if (slicelength < needed) {
-			if (array_resize(self, Py_Size(self) +
+			if (array_resize(self, Py_SIZE(self) +
 					 needed - slicelength) < 0)
 				return -1;
 			memmove(self->ob_item + (start + needed) * itemsize,
 				self->ob_item + stop * itemsize,
-				(Py_Size(self) - start - needed) * itemsize);
+				(Py_SIZE(self) - start - needed) * itemsize);
 		}
 		if (needed > 0)
 			memcpy(self->ob_item + start * itemsize,
@@ -1736,19 +1736,19 @@
 		     cur += step, i++) {
 			Py_ssize_t lim = step - 1;
 
-			if (cur + step >= Py_Size(self))
-				lim = Py_Size(self) - cur - 1;
+			if (cur + step >= Py_SIZE(self))
+				lim = Py_SIZE(self) - cur - 1;
 			memmove(self->ob_item + (cur - i) * itemsize,
 				self->ob_item + (cur + 1) * itemsize,
 				lim * itemsize);
 		}
 		cur = start + slicelength * step;
-		if (cur < Py_Size(self)) {
+		if (cur < Py_SIZE(self)) {
 			memmove(self->ob_item + (cur-slicelength) * itemsize,
 				self->ob_item + cur * itemsize,
-				(Py_Size(self) - cur) * itemsize);
+				(Py_SIZE(self) - cur) * itemsize);
 		}
-		if (array_resize(self, Py_Size(self) - slicelength) < 0)
+		if (array_resize(self, Py_SIZE(self) - slicelength) < 0)
 			return -1;
 		return 0;
 	}
@@ -1794,14 +1794,14 @@
         view->buf = (void *)self->ob_item;
         if (view->buf == NULL)
                 view->buf = (void *)emptybuf;
-        view->len = (Py_Size(self)) * self->ob_descr->itemsize;
+        view->len = (Py_SIZE(self)) * self->ob_descr->itemsize;
         view->readonly = 0;
         view->ndim = 1;
         view->itemsize = self->ob_descr->itemsize;
         view->suboffsets = NULL;
         view->shape = NULL;
         if ((flags & PyBUF_ND)==PyBUF_ND) {
-                view->shape = &((Py_Size(self)));
+                view->shape = &((Py_SIZE(self)));
         }
         view->strides = NULL;
         if ((flags & PyBUF_STRIDES)==PyBUF_STRIDES)
@@ -1935,9 +1935,9 @@
 						return NULL;
 					}
 					self->ob_item = item;
-					Py_Size(self) = n / sizeof(Py_UNICODE);
+					Py_SIZE(self) = n / sizeof(Py_UNICODE);
 					memcpy(item, PyUnicode_AS_DATA(initial), n);
-					self->allocated = Py_Size(self);
+					self->allocated = Py_SIZE(self);
 				}
 			}
 			if (it != NULL) {
@@ -2108,7 +2108,7 @@
 arrayiter_next(arrayiterobject *it)
 {
 	assert(PyArrayIter_Check(it));
-	if (it->index < Py_Size(it->ao))
+	if (it->index < Py_SIZE(it->ao))
 		return (*it->getitem)(it->ao, it->index++);
 	return NULL;
 }
@@ -2180,7 +2180,7 @@
 
 	if (PyType_Ready(&Arraytype) < 0)
             return;
-	Py_Type(&PyArrayIter_Type) = &PyType_Type;
+	Py_TYPE(&PyArrayIter_Type) = &PyType_Type;
 	m = Py_InitModule3("array", a_methods, module_doc);
 	if (m == NULL)
 		return;

Modified: python/branches/py3k/Modules/bz2module.c
==============================================================================
--- python/branches/py3k/Modules/bz2module.c	(original)
+++ python/branches/py3k/Modules/bz2module.c	Wed Dec 19 03:45:37 2007
@@ -41,7 +41,7 @@
 #define MODE_READ_EOF 2
 #define MODE_WRITE    3
 
-#define BZ2FileObject_Check(v)	(Py_Type(v) == &BZ2File_Type)
+#define BZ2FileObject_Check(v)	(Py_TYPE(v) == &BZ2File_Type)
 
 
 #ifdef BZ_CONFIG_ERROR
@@ -1240,7 +1240,7 @@
 	Util_DropReadAhead(self);
 	if (self->rawfp != NULL)
 		fclose(self->rawfp);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 /* This is a hacked version of Python's fileobject.c:file_getiter(). */
@@ -1552,7 +1552,7 @@
 		PyThread_free_lock(self->lock);
 #endif
 	BZ2_bzCompressEnd(&self->bzs);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 
@@ -1777,7 +1777,7 @@
 #endif
 	Py_XDECREF(self->unused_data);
 	BZ2_bzDecompressEnd(&self->bzs);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 
@@ -2031,9 +2031,9 @@
 {
 	PyObject *m;
 
-	Py_Type(&BZ2File_Type) = &PyType_Type;
-	Py_Type(&BZ2Comp_Type) = &PyType_Type;
-	Py_Type(&BZ2Decomp_Type) = &PyType_Type;
+	Py_TYPE(&BZ2File_Type) = &PyType_Type;
+	Py_TYPE(&BZ2Comp_Type) = &PyType_Type;
+	Py_TYPE(&BZ2Decomp_Type) = &PyType_Type;
 
 	m = Py_InitModule3("bz2", bz2_methods, bz2__doc__);
 	if (m == NULL)

Modified: python/branches/py3k/Modules/cStringIO.c
==============================================================================
--- python/branches/py3k/Modules/cStringIO.c	(original)
+++ python/branches/py3k/Modules/cStringIO.c	Wed Dec 19 03:45:37 2007
@@ -738,8 +738,8 @@
   d = PyModule_GetDict(m);
   
   /* Export C API */
-  Py_Type(&Itype)=&PyType_Type;
-  Py_Type(&Otype)=&PyType_Type;
+  Py_TYPE(&Itype)=&PyType_Type;
+  Py_TYPE(&Otype)=&PyType_Type;
   if (PyType_Ready(&Otype) < 0) return;
   if (PyType_Ready(&Itype) < 0) return;
   PyDict_SetItemString(d,"cStringIO_CAPI",

Modified: python/branches/py3k/Modules/cjkcodecs/multibytecodec.c
==============================================================================
--- python/branches/py3k/Modules/cjkcodecs/multibytecodec.c	(original)
+++ python/branches/py3k/Modules/cjkcodecs/multibytecodec.c	Wed Dec 19 03:45:37 2007
@@ -953,7 +953,7 @@
 {
 	PyObject_GC_UnTrack(self);
 	ERROR_DECREF(self->errors);
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static PyTypeObject MultibyteIncrementalEncoder_Type = {
@@ -1153,7 +1153,7 @@
 {
 	PyObject_GC_UnTrack(self);
 	ERROR_DECREF(self->errors);
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static PyTypeObject MultibyteIncrementalDecoder_Type = {
@@ -1479,7 +1479,7 @@
 	PyObject_GC_UnTrack(self);
 	ERROR_DECREF(self->errors);
 	Py_DECREF(self->stream);
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static PyTypeObject MultibyteStreamReader_Type = {
@@ -1682,7 +1682,7 @@
 	PyObject_GC_UnTrack(self);
 	ERROR_DECREF(self->errors);
 	Py_DECREF(self->stream);
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static struct PyMethodDef mbstreamwriter_methods[] = {

Modified: python/branches/py3k/Modules/datetimemodule.c
==============================================================================
--- python/branches/py3k/Modules/datetimemodule.c	(original)
+++ python/branches/py3k/Modules/datetimemodule.c	Wed Dec 19 03:45:37 2007
@@ -764,7 +764,7 @@
 	PyErr_Format(PyExc_TypeError,
 		     "tzinfo argument must be None or of a tzinfo subclass, "
 		     "not type '%s'",
-		     Py_Type(p)->tp_name);
+		     Py_TYPE(p)->tp_name);
 	return -1;
 }
 
@@ -855,7 +855,7 @@
 		PyErr_Format(PyExc_TypeError,
 			     "tzinfo.%s() must return None or "
 			     "timedelta, not '%s'",
-			     name, Py_Type(u)->tp_name);
+			     name, Py_TYPE(u)->tp_name);
 	}
 
 	Py_DECREF(u);
@@ -950,7 +950,7 @@
 		if (!PyUnicode_Check(result)) {
 			PyErr_Format(PyExc_TypeError, "tzinfo.tzname() must "
 				     "return None or a string, not '%s'",
-				     Py_Type(result)->tp_name);
+				     Py_TYPE(result)->tp_name);
 			Py_DECREF(result);
 			result = NULL;
 		}
@@ -1293,7 +1293,7 @@
 			assert(PyUnicode_Check(Zreplacement));
 			ptoappend = PyUnicode_AsStringAndSize(Zreplacement,
                                                               &ntoappend);
-			ntoappend = Py_Size(Zreplacement);
+			ntoappend = Py_SIZE(Zreplacement);
 		}
 		else {
 			/* percent followed by neither z nor Z */
@@ -1425,7 +1425,7 @@
 {
 	PyErr_Format(PyExc_TypeError,
 		     "can't compare %s to %s",
-		     Py_Type(a)->tp_name, Py_Type(b)->tp_name);
+		     Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
 	return NULL;
 }
 
@@ -1869,7 +1869,7 @@
 
 	PyErr_Format(PyExc_TypeError,
 		     "unsupported type for timedelta %s component: %s",
-		     tag, Py_Type(num)->tp_name);
+		     tag, Py_TYPE(num)->tp_name);
 	return NULL;
 }
 
@@ -1973,18 +1973,18 @@
 {
 	if (GET_TD_MICROSECONDS(self) != 0)
 		return PyUnicode_FromFormat("%s(%d, %d, %d)",
-		                            Py_Type(self)->tp_name,
+		                            Py_TYPE(self)->tp_name,
 		                            GET_TD_DAYS(self),
 		                            GET_TD_SECONDS(self),
 		                            GET_TD_MICROSECONDS(self));
 	if (GET_TD_SECONDS(self) != 0)
 		return PyUnicode_FromFormat("%s(%d, %d)",
-		                            Py_Type(self)->tp_name,
+		                            Py_TYPE(self)->tp_name,
 		                            GET_TD_DAYS(self),
 		                            GET_TD_SECONDS(self));
 
 	return PyUnicode_FromFormat("%s(%d)",
-	                            Py_Type(self)->tp_name,
+	                            Py_TYPE(self)->tp_name,
 	                            GET_TD_DAYS(self));
 }
 
@@ -2031,7 +2031,7 @@
 static PyObject *
 delta_reduce(PyDateTime_Delta* self)
 {
-	return Py_BuildValue("ON", Py_Type(self), delta_getstate(self));
+	return Py_BuildValue("ON", Py_TYPE(self), delta_getstate(self));
 }
 
 #define OFFSET(field)  offsetof(PyDateTime_Delta, field)
@@ -2385,7 +2385,7 @@
 date_repr(PyDateTime_Date *self)
 {
 	return PyUnicode_FromFormat("%s(%d, %d, %d)",
-	                            Py_Type(self)->tp_name,
+	                            Py_TYPE(self)->tp_name,
 	                            GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
 }
 
@@ -2522,7 +2522,7 @@
 	tuple = Py_BuildValue("iii", year, month, day);
 	if (tuple == NULL)
 		return NULL;
-	clone = date_new(Py_Type(self), tuple, NULL);
+	clone = date_new(Py_TYPE(self), tuple, NULL);
 	Py_DECREF(tuple);
 	return clone;
 }
@@ -2590,7 +2590,7 @@
 static PyObject *
 date_reduce(PyDateTime_Date *self, PyObject *arg)
 {
-	return Py_BuildValue("(ON)", Py_Type(self), date_getstate(self));
+	return Py_BuildValue("(ON)", Py_TYPE(self), date_getstate(self));
 }
 
 static PyMethodDef date_methods[] = {
@@ -2893,10 +2893,10 @@
 
 	if (state == Py_None) {
 		Py_DECREF(state);
-		return Py_BuildValue("(ON)", Py_Type(self), args);
+		return Py_BuildValue("(ON)", Py_TYPE(self), args);
 	}
 	else
-		return Py_BuildValue("(ONN)", Py_Type(self), args, state);
+		return Py_BuildValue("(ONN)", Py_TYPE(self), args, state);
 }
 
 static PyMethodDef tzinfo_methods[] = {
@@ -3089,7 +3089,7 @@
 	if (HASTZINFO(self)) {
 		Py_XDECREF(self->tzinfo);
 	}
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 /*
@@ -3122,7 +3122,7 @@
 static PyObject *
 time_repr(PyDateTime_Time *self)
 {
-	const char *type_name = Py_Type(self)->tp_name;
+	const char *type_name = Py_TYPE(self)->tp_name;
 	int h = TIME_GET_HOUR(self);
 	int m = TIME_GET_MINUTE(self);
 	int s = TIME_GET_SECOND(self);
@@ -3346,7 +3346,7 @@
 	tuple = Py_BuildValue("iiiiO", hh, mm, ss, us, tzinfo);
 	if (tuple == NULL)
 		return NULL;
-	clone = time_new(Py_Type(self), tuple, NULL);
+	clone = time_new(Py_TYPE(self), tuple, NULL);
 	Py_DECREF(tuple);
 	return clone;
 }
@@ -3400,7 +3400,7 @@
 static PyObject *
 time_reduce(PyDateTime_Time *self, PyObject *arg)
 {
-	return Py_BuildValue("(ON)", Py_Type(self), time_getstate(self));
+	return Py_BuildValue("(ON)", Py_TYPE(self), time_getstate(self));
 }
 
 static PyMethodDef time_methods[] = {
@@ -3897,7 +3897,7 @@
 	if (HASTZINFO(self)) {
 		Py_XDECREF(self->tzinfo);
 	}
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 /*
@@ -4045,7 +4045,7 @@
 static PyObject *
 datetime_repr(PyDateTime_DateTime *self)
 {
-	const char *type_name = Py_Type(self)->tp_name;
+	const char *type_name = Py_TYPE(self)->tp_name;
 	PyObject *baserepr;
 
 	if (DATE_GET_MICROSECOND(self)) {
@@ -4262,7 +4262,7 @@
 	tuple = Py_BuildValue("iiiiiiiO", y, m, d, hh, mm, ss, us, tzinfo);
 	if (tuple == NULL)
 		return NULL;
-	clone = datetime_new(Py_Type(self), tuple, NULL);
+	clone = datetime_new(Py_TYPE(self), tuple, NULL);
 	Py_DECREF(tuple);
 	return clone;
 }
@@ -4450,7 +4450,7 @@
 static PyObject *
 datetime_reduce(PyDateTime_DateTime *self, PyObject *arg)
 {
-	return Py_BuildValue("(ON)", Py_Type(self), datetime_getstate(self));
+	return Py_BuildValue("(ON)", Py_TYPE(self), datetime_getstate(self));
 }
 
 static PyMethodDef datetime_methods[] = {

Modified: python/branches/py3k/Modules/dbmmodule.c
==============================================================================
--- python/branches/py3k/Modules/dbmmodule.c	(original)
+++ python/branches/py3k/Modules/dbmmodule.c	Wed Dec 19 03:45:37 2007
@@ -36,7 +36,7 @@
 
 static PyTypeObject Dbmtype;
 
-#define is_dbmobject(v) (Py_Type(v) == &Dbmtype)
+#define is_dbmobject(v) (Py_TYPE(v) == &Dbmtype)
 #define check_dbmobject_open(v) if ((v)->di_dbm == NULL) \
                { PyErr_SetString(DbmError, "DBM object has already been closed"); \
                  return NULL; }

Modified: python/branches/py3k/Modules/dlmodule.c
==============================================================================
--- python/branches/py3k/Modules/dlmodule.c	(original)
+++ python/branches/py3k/Modules/dlmodule.c	Wed Dec 19 03:45:37 2007
@@ -62,7 +62,7 @@
 		name = PyUnicode_AsString(args);
 	} else {
 		PyErr_Format(PyExc_TypeError, "expected string, found %.200s",
-			     Py_Type(args)->tp_name);
+			     Py_TYPE(args)->tp_name);
 		return NULL;
 	}
 	func = dlsym(xp->dl_handle, name);
@@ -238,7 +238,7 @@
 	PyObject *m, *d, *x;
 
 	/* Initialize object type */
-	Py_Type(&Dltype) = &PyType_Type;
+	Py_TYPE(&Dltype) = &PyType_Type;
 
 	/* Create the module and add the functions */
 	m = Py_InitModule("dl", dl_methods);

Modified: python/branches/py3k/Modules/gcmodule.c
==============================================================================
--- python/branches/py3k/Modules/gcmodule.c	(original)
+++ python/branches/py3k/Modules/gcmodule.c	Wed Dec 19 03:45:37 2007
@@ -235,7 +235,7 @@
 	PyGC_Head *gc = containers->gc.gc_next;
 	for (; gc != containers; gc = gc->gc.gc_next) {
 		assert(gc->gc.gc_refs == GC_REACHABLE);
-		gc->gc.gc_refs = Py_Refcnt(FROM_GC(gc));
+		gc->gc.gc_refs = Py_REFCNT(FROM_GC(gc));
 		/* Python's cyclic gc should never see an incoming refcount
 		 * of 0:  if something decref'ed to 0, it should have been
 		 * deallocated immediately at that time.
@@ -287,7 +287,7 @@
 	traverseproc traverse;
 	PyGC_Head *gc = containers->gc.gc_next;
 	for (; gc != containers; gc=gc->gc.gc_next) {
-		traverse = Py_Type(FROM_GC(gc))->tp_traverse;
+		traverse = Py_TYPE(FROM_GC(gc))->tp_traverse;
 		(void) traverse(FROM_GC(gc),
 			       (visitproc)visit_decref,
 			       NULL);
@@ -372,7 +372,7 @@
                          * the next object to visit.
                          */
                         PyObject *op = FROM_GC(gc);
-                        traverseproc traverse = Py_Type(op)->tp_traverse;
+                        traverseproc traverse = Py_TYPE(op)->tp_traverse;
                         assert(gc->gc.gc_refs > 0);
                         gc->gc.gc_refs = GC_REACHABLE;
                         (void) traverse(op,
@@ -456,7 +456,7 @@
 	PyGC_Head *gc = finalizers->gc.gc_next;
 	for (; gc != finalizers; gc = gc->gc.gc_next) {
 		/* Note that the finalizers list may grow during this. */
-		traverse = Py_Type(FROM_GC(gc))->tp_traverse;
+		traverse = Py_TYPE(FROM_GC(gc))->tp_traverse;
 		(void) traverse(FROM_GC(gc),
 				(visitproc)visit_move,
 				(void *)finalizers);
@@ -501,7 +501,7 @@
 		assert(IS_TENTATIVELY_UNREACHABLE(op));
 		next = gc->gc.gc_next;
 
-		if (! PyType_SUPPORTS_WEAKREFS(Py_Type(op)))
+		if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
 			continue;
 
 		/* It supports weakrefs.  Does it have any? */
@@ -620,7 +620,7 @@
 debug_cycle(char *msg, PyObject *op)
 {
 	PySys_WriteStderr("gc: %.100s <%.100s %p>\n",
-			  msg, Py_Type(op)->tp_name, op);
+			  msg, Py_TYPE(op)->tp_name, op);
 }
 
 /* Handle uncollectable garbage (cycles with finalizers, and stuff reachable
@@ -673,7 +673,7 @@
 			PyList_Append(garbage, op);
 		}
 		else {
-			if ((clear = Py_Type(op)->tp_clear) != NULL) {
+			if ((clear = Py_TYPE(op)->tp_clear) != NULL) {
 				Py_INCREF(op);
 				clear(op);
 				Py_DECREF(op);
@@ -1042,7 +1042,7 @@
 	traverseproc traverse;
 	for (gc = list->gc.gc_next; gc != list; gc = gc->gc.gc_next) {
 		obj = FROM_GC(gc);
-		traverse = Py_Type(obj)->tp_traverse;
+		traverse = Py_TYPE(obj)->tp_traverse;
 		if (obj == objs || obj == resultlist)
 			continue;
 		if (traverse(obj, (visitproc)referrersvisit, objs)) {
@@ -1099,7 +1099,7 @@
 
 		if (! PyObject_IS_GC(obj))
 			continue;
-		traverse = Py_Type(obj)->tp_traverse;
+		traverse = Py_TYPE(obj)->tp_traverse;
 		if (! traverse)
 			continue;
 		if (traverse(obj, (visitproc)referentsvisit, result)) {
@@ -1320,13 +1320,13 @@
 PyVarObject *
 _PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems)
 {
-	const size_t basicsize = _PyObject_VAR_SIZE(Py_Type(op), nitems);
+	const size_t basicsize = _PyObject_VAR_SIZE(Py_TYPE(op), nitems);
 	PyGC_Head *g = AS_GC(op);
 	g = (PyGC_Head *)PyObject_REALLOC(g,  sizeof(PyGC_Head) + basicsize);
 	if (g == NULL)
 		return (PyVarObject *)PyErr_NoMemory();
 	op = (PyVarObject *) FROM_GC(g);
-	Py_Size(op) = nitems;
+	Py_SIZE(op) = nitems;
 	return op;
 }
 

Modified: python/branches/py3k/Modules/gdbmmodule.c
==============================================================================
--- python/branches/py3k/Modules/gdbmmodule.c	(original)
+++ python/branches/py3k/Modules/gdbmmodule.c	Wed Dec 19 03:45:37 2007
@@ -36,7 +36,7 @@
 
 static PyTypeObject Dbmtype;
 
-#define is_dbmobject(v) (Py_Type(v) == &Dbmtype)
+#define is_dbmobject(v) (Py_TYPE(v) == &Dbmtype)
 #define check_dbmobject_open(v) if ((v)->di_dbm == NULL) \
     { PyErr_SetString(DbmError, "GDBM object has already been closed"); \
       return NULL; }

Modified: python/branches/py3k/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/py3k/Modules/itertoolsmodule.c	(original)
+++ python/branches/py3k/Modules/itertoolsmodule.c	Wed Dec 19 03:45:37 2007
@@ -59,7 +59,7 @@
 	Py_XDECREF(gbo->tgtkey);
 	Py_XDECREF(gbo->currkey);
 	Py_XDECREF(gbo->currvalue);
-	Py_Type(gbo)->tp_free(gbo);
+	Py_TYPE(gbo)->tp_free(gbo);
 }
 
 static int
@@ -714,7 +714,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->saved);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -857,7 +857,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->func);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -877,7 +877,7 @@
 	PyObject *(*iternext)(PyObject *);
 
 	assert(PyIter_Check(it));
-	iternext = *Py_Type(it)->tp_iternext;
+	iternext = *Py_TYPE(it)->tp_iternext;
 	for (;;) {
 		item = iternext(it);
 		if (item == NULL)
@@ -1000,7 +1000,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->func);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1022,7 +1022,7 @@
 		return NULL;
 
 	assert(PyIter_Check(it));
-	item = (*Py_Type(it)->tp_iternext)(it);
+	item = (*Py_TYPE(it)->tp_iternext)(it);
 	if (item == NULL)
 		return NULL;
 
@@ -1190,7 +1190,7 @@
 {
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1209,7 +1209,7 @@
 	PyObject *(*iternext)(PyObject *);
 
 	assert(PyIter_Check(it));
-	iternext = *Py_Type(it)->tp_iternext;
+	iternext = *Py_TYPE(it)->tp_iternext;
 	while (lz->cnt < lz->next) {
 		item = iternext(it);
 		if (item == NULL)
@@ -1333,7 +1333,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->func);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1352,7 +1352,7 @@
 	PyObject *it = lz->it;
 
 	assert(PyIter_Check(it));
-	args = (*Py_Type(it)->tp_iternext)(it);
+	args = (*Py_TYPE(it)->tp_iternext)(it);
 	if (args == NULL)
 		return NULL;
 	if (!PyTuple_CheckExact(args)) {
@@ -1478,7 +1478,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->iters);
 	Py_XDECREF(lz->func);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1656,7 +1656,7 @@
 {
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->ittuple);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1787,7 +1787,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->func);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1807,7 +1807,7 @@
 	PyObject *(*iternext)(PyObject *);
 
 	assert(PyIter_Check(it));
-	iternext = *Py_Type(it)->tp_iternext;
+	iternext = *Py_TYPE(it)->tp_iternext;
 	for (;;) {
 		item = iternext(it);
 		if (item == NULL)
@@ -1931,7 +1931,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->func);
 	Py_XDECREF(lz->it);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -1951,7 +1951,7 @@
 	PyObject *(*iternext)(PyObject *);
 
 	assert(PyIter_Check(it));
-	iternext = *Py_Type(it)->tp_iternext;
+	iternext = *Py_TYPE(it)->tp_iternext;
 	for (;;) {
 		item = iternext(it);
 		if (item == NULL)
@@ -2253,7 +2253,7 @@
 	PyObject_GC_UnTrack(lz);
 	Py_XDECREF(lz->ittuple);
 	Py_XDECREF(lz->result);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -2276,12 +2276,12 @@
 
 	if (tuplesize == 0)
 		return NULL;
-	if (Py_Refcnt(result) == 1) {
+	if (Py_REFCNT(result) == 1) {
 		Py_INCREF(result);
 		for (i=0 ; i < tuplesize ; i++) {
 			it = PyTuple_GET_ITEM(lz->ittuple, i);
 			assert(PyIter_Check(it));
-			item = (*Py_Type(it)->tp_iternext)(it);
+			item = (*Py_TYPE(it)->tp_iternext)(it);
 			if (item == NULL) {
 				Py_DECREF(result);
 				return NULL;
@@ -2297,7 +2297,7 @@
 		for (i=0 ; i < tuplesize ; i++) {
 			it = PyTuple_GET_ITEM(lz->ittuple, i);
 			assert(PyIter_Check(it));
-			item = (*Py_Type(it)->tp_iternext)(it);
+			item = (*Py_TYPE(it)->tp_iternext)(it);
 			if (item == NULL) {
 				Py_DECREF(result);
 				return NULL;
@@ -2403,7 +2403,7 @@
 {
 	PyObject_GC_UnTrack(ro);
 	Py_XDECREF(ro->element);
-	Py_Type(ro)->tp_free(ro);
+	Py_TYPE(ro)->tp_free(ro);
 }
 
 static int
@@ -2588,7 +2588,7 @@
 	Py_XDECREF(lz->ittuple);
 	Py_XDECREF(lz->result);
 	Py_XDECREF(lz->fillvalue);
-	Py_Type(lz)->tp_free(lz);
+	Py_TYPE(lz)->tp_free(lz);
 }
 
 static int
@@ -2614,7 +2614,7 @@
 		return NULL;
         if (lz->numactive == 0)
                 return NULL;
-	if (Py_Refcnt(result) == 1) {
+	if (Py_REFCNT(result) == 1) {
 		Py_INCREF(result);
 		for (i=0 ; i < tuplesize ; i++) {
 			it = PyTuple_GET_ITEM(lz->ittuple, i);
@@ -2623,7 +2623,7 @@
                                 item = lz->fillvalue;
                         } else {
                                 assert(PyIter_Check(it));
-                                item = (*Py_Type(it)->tp_iternext)(it);
+                                item = (*Py_TYPE(it)->tp_iternext)(it);
                                 if (item == NULL) {
                                         lz->numactive -= 1;      
                                         if (lz->numactive == 0) {
@@ -2652,7 +2652,7 @@
                                 item = lz->fillvalue;
                         } else {
                                 assert(PyIter_Check(it));
-                                item = (*Py_Type(it)->tp_iternext)(it);
+                                item = (*Py_TYPE(it)->tp_iternext)(it);
                                 if (item == NULL) {
                                         lz->numactive -= 1;      
                                         if (lz->numactive == 0) {
@@ -2783,7 +2783,7 @@
 		NULL
 	};
 
-	Py_Type(&teedataobject_type) = &PyType_Type;
+	Py_TYPE(&teedataobject_type) = &PyType_Type;
 	m = Py_InitModule3("itertools", module_methods, module_doc);
 	if (m == NULL)
 		return;

Modified: python/branches/py3k/Modules/mathmodule.c
==============================================================================
--- python/branches/py3k/Modules/mathmodule.c	(original)
+++ python/branches/py3k/Modules/mathmodule.c	Wed Dec 19 03:45:37 2007
@@ -118,7 +118,7 @@
 			return NULL;
 	}
 
-	method = _PyType_Lookup(Py_Type(number), ceil_str);
+	method = _PyType_Lookup(Py_TYPE(number), ceil_str);
 	if (method == NULL)
 		return math_1(number, ceil);
 	else
@@ -148,7 +148,7 @@
 			return NULL;
 	}
 
-	method = _PyType_Lookup(Py_Type(number), floor_str);
+	method = _PyType_Lookup(Py_TYPE(number), floor_str);
 	if (method == NULL)
 		return math_1(number, floor);
 	else

Modified: python/branches/py3k/Modules/md5module.c
==============================================================================
--- python/branches/py3k/Modules/md5module.c	(original)
+++ python/branches/py3k/Modules/md5module.c	Wed Dec 19 03:45:37 2007
@@ -340,7 +340,7 @@
 {
     MD5object *newobj;
 
-    if (Py_Type(self) == &MD5type) {
+    if (Py_TYPE(self) == &MD5type) {
         if ( (newobj = newMD5object())==NULL)
             return NULL;
     } else {
@@ -552,7 +552,7 @@
 {
     PyObject *m;
 
-    Py_Type(&MD5type) = &PyType_Type;
+    Py_TYPE(&MD5type) = &PyType_Type;
     if (PyType_Ready(&MD5type) < 0)
         return;
     m = Py_InitModule("_md5", MD5_functions);

Modified: python/branches/py3k/Modules/mmapmodule.c
==============================================================================
--- python/branches/py3k/Modules/mmapmodule.c	(original)
+++ python/branches/py3k/Modules/mmapmodule.c	Wed Dec 19 03:45:37 2007
@@ -1253,7 +1253,7 @@
 	PyObject *dict, *module;
 
 	/* Patch the object type */
-	Py_Type(&mmap_object_type) = &PyType_Type;
+	Py_TYPE(&mmap_object_type) = &PyType_Type;
 
 	module = Py_InitModule("mmap", mmap_functions);
 	if (module == NULL)

Modified: python/branches/py3k/Modules/parsermodule.c
==============================================================================
--- python/branches/py3k/Modules/parsermodule.c	(original)
+++ python/branches/py3k/Modules/parsermodule.c	Wed Dec 19 03:45:37 2007
@@ -694,7 +694,7 @@
                 PyErr_Format(parser_error,
                              "second item in terminal node must be a string,"
                              " found %s",
-                             Py_Type(temp)->tp_name);
+                             Py_TYPE(temp)->tp_name);
                 Py_DECREF(temp);
                 Py_DECREF(elem);
                 return 0;
@@ -708,7 +708,7 @@
                         PyErr_Format(parser_error,
                                      "third item in terminal node must be an"
                                      " integer, found %s",
-				     Py_Type(temp)->tp_name);
+				     Py_TYPE(temp)->tp_name);
                         Py_DECREF(o);
                         Py_DECREF(temp);
                         Py_DECREF(elem);
@@ -3056,7 +3056,7 @@
 {
     PyObject *module, *copyreg;
 
-    Py_Type(&PyST_Type) = &PyType_Type;
+    Py_TYPE(&PyST_Type) = &PyType_Type;
     module = Py_InitModule("parser", parser_functions);
     if (module == NULL)
     	return;

Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c	(original)
+++ python/branches/py3k/Modules/posixmodule.c	Wed Dec 19 03:45:37 2007
@@ -2706,7 +2706,7 @@
 	long intval;
 	if (PyFloat_Check(t)) {
 		double tval = PyFloat_AsDouble(t);
-		PyObject *intobj = Py_Type(t)->tp_as_number->nb_int(t);
+		PyObject *intobj = Py_TYPE(t)->tp_as_number->nb_int(t);
 		if (!intobj)
 			return -1;
 		intval = PyLong_AsLong(intobj);

Modified: python/branches/py3k/Modules/pyexpat.c
==============================================================================
--- python/branches/py3k/Modules/pyexpat.c	(original)
+++ python/branches/py3k/Modules/pyexpat.c	Wed Dec 19 03:45:37 2007
@@ -871,10 +871,10 @@
     else {
         PyErr_Format(PyExc_TypeError,
                      "read() did not return a bytes object (type=%.400s)",
-                     Py_Type(str)->tp_name);
+                     Py_TYPE(str)->tp_name);
         goto finally;
     }
-    len = Py_Size(str);
+    len = Py_SIZE(str);
     if (len > buf_size) {
         PyErr_Format(PyExc_ValueError,
                      "read() returned too much data: "
@@ -1738,7 +1738,7 @@
     if (modelmod_name == NULL)
         return;
 
-    Py_Type(&Xmlparsetype) = &PyType_Type;
+    Py_TYPE(&Xmlparsetype) = &PyType_Type;
 
     /* Create the module and add the functions */
     m = Py_InitModule3(MODULE_NAME, pyexpat_methods,

Modified: python/branches/py3k/Modules/selectmodule.c
==============================================================================
--- python/branches/py3k/Modules/selectmodule.c	(original)
+++ python/branches/py3k/Modules/selectmodule.c	Wed Dec 19 03:45:37 2007
@@ -701,7 +701,7 @@
 #else
 	{
 #endif
-		Py_Type(&poll_Type) = &PyType_Type;
+		Py_TYPE(&poll_Type) = &PyType_Type;
 		PyModule_AddIntConstant(m, "POLLIN", POLLIN);
 		PyModule_AddIntConstant(m, "POLLPRI", POLLPRI);
 		PyModule_AddIntConstant(m, "POLLOUT", POLLOUT);

Modified: python/branches/py3k/Modules/sha1module.c
==============================================================================
--- python/branches/py3k/Modules/sha1module.c	(original)
+++ python/branches/py3k/Modules/sha1module.c	Wed Dec 19 03:45:37 2007
@@ -316,7 +316,7 @@
 {
     SHA1object *newobj;
 
-    if (Py_Type(self) == &SHA1type) {
+    if (Py_TYPE(self) == &SHA1type) {
         if ( (newobj = newSHA1object())==NULL)
             return NULL;
     } else {
@@ -528,7 +528,7 @@
 {
     PyObject *m;
 
-    Py_Type(&SHA1type) = &PyType_Type;
+    Py_TYPE(&SHA1type) = &PyType_Type;
     if (PyType_Ready(&SHA1type) < 0)
         return;
     m = Py_InitModule("_sha1", SHA1_functions);

Modified: python/branches/py3k/Modules/sha256module.c
==============================================================================
--- python/branches/py3k/Modules/sha256module.c	(original)
+++ python/branches/py3k/Modules/sha256module.c	Wed Dec 19 03:45:37 2007
@@ -409,7 +409,7 @@
 {
     SHAobject *newobj;
 
-    if (Py_Type(self) == &SHA256type) {
+    if (Py_TYPE(self) == &SHA256type) {
         if ( (newobj = newSHA256object())==NULL)
             return NULL;
     } else {
@@ -687,10 +687,10 @@
 {
     PyObject *m;
 
-    Py_Type(&SHA224type) = &PyType_Type;
+    Py_TYPE(&SHA224type) = &PyType_Type;
     if (PyType_Ready(&SHA224type) < 0)
         return;
-    Py_Type(&SHA256type) = &PyType_Type;
+    Py_TYPE(&SHA256type) = &PyType_Type;
     if (PyType_Ready(&SHA256type) < 0)
         return;
     m = Py_InitModule("_sha256", SHA_functions);

Modified: python/branches/py3k/Modules/sha512module.c
==============================================================================
--- python/branches/py3k/Modules/sha512module.c	(original)
+++ python/branches/py3k/Modules/sha512module.c	Wed Dec 19 03:45:37 2007
@@ -753,10 +753,10 @@
 {
     PyObject *m;
 
-    Py_Type(&SHA384type) = &PyType_Type;
+    Py_TYPE(&SHA384type) = &PyType_Type;
     if (PyType_Ready(&SHA384type) < 0)
         return;
-    Py_Type(&SHA512type) = &PyType_Type;
+    Py_TYPE(&SHA512type) = &PyType_Type;
     if (PyType_Ready(&SHA512type) < 0)
         return;
     m = Py_InitModule("_sha512", SHA_functions);

Modified: python/branches/py3k/Modules/socketmodule.c
==============================================================================
--- python/branches/py3k/Modules/socketmodule.c	(original)
+++ python/branches/py3k/Modules/socketmodule.c	Wed Dec 19 03:45:37 2007
@@ -1135,7 +1135,7 @@
 				PyExc_TypeError,
 				"getsockaddrarg: "
 				"AF_NETLINK address must be tuple, not %.500s",
-				Py_Type(args)->tp_name);
+				Py_TYPE(args)->tp_name);
 			return 0;
 		}
 		if (!PyArg_ParseTuple(args, "II:getsockaddrarg", &pid, &groups))
@@ -1158,7 +1158,7 @@
 				PyExc_TypeError,
 				"getsockaddrarg: "
 				"AF_INET address must be tuple, not %.500s",
-				Py_Type(args)->tp_name);
+				Py_TYPE(args)->tp_name);
 			return 0;
 		}
 		if (!PyArg_ParseTuple(args, "eti:getsockaddrarg",
@@ -1188,7 +1188,7 @@
 				PyExc_TypeError,
 				"getsockaddrarg: "
 				"AF_INET6 address must be tuple, not %.500s",
-				Py_Type(args)->tp_name);
+				Py_TYPE(args)->tp_name);
 			return 0;
 		}
 		if (!PyArg_ParseTuple(args, "eti|ii",
@@ -1310,7 +1310,7 @@
 				PyExc_TypeError,
 				"getsockaddrarg: "
 				"AF_PACKET address must be tuple, not %.500s",
-				Py_Type(args)->tp_name);
+				Py_TYPE(args)->tp_name);
 			return 0;
 		}
 		if (!PyArg_ParseTuple(args, "si|iiy#", &interfaceName,
@@ -2580,7 +2580,7 @@
 {
 	if (s->sock_fd != -1)
 		(void) SOCKETCLOSE(s->sock_fd);
-	Py_Type(s)->tp_free((PyObject *)s);
+	Py_TYPE(s)->tp_free((PyObject *)s);
 }
 
 
@@ -3275,7 +3275,7 @@
 	else
 		return PyErr_Format(PyExc_TypeError,
 				    "expected int/long, %s found",
-				    Py_Type(arg)->tp_name);
+				    Py_TYPE(arg)->tp_name);
 	if (x == (unsigned long) -1 && PyErr_Occurred())
 		return NULL;
 	return PyLong_FromUnsignedLong(ntohl(x));
@@ -3334,7 +3334,7 @@
 	else
 		return PyErr_Format(PyExc_TypeError,
 				    "expected int/long, %s found",
-				    Py_Type(arg)->tp_name);
+				    Py_TYPE(arg)->tp_name);
 	return PyLong_FromUnsignedLong(htonl((unsigned long)x));
 }
 
@@ -3962,7 +3962,7 @@
 	if (!os_init())
 		return;
 
-	Py_Type(&sock_type) = &PyType_Type;
+	Py_TYPE(&sock_type) = &PyType_Type;
 	m = Py_InitModule3(PySocket_MODULE_NAME,
 			   socket_methods,
 			   socket_doc);

Modified: python/branches/py3k/Modules/threadmodule.c
==============================================================================
--- python/branches/py3k/Modules/threadmodule.c	(original)
+++ python/branches/py3k/Modules/threadmodule.c	Wed Dec 19 03:45:37 2007
@@ -250,7 +250,7 @@
 	}
 
 	local_clear(self);
-	Py_Type(self)->tp_free((PyObject*)self);
+	Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 static PyObject *
@@ -282,8 +282,8 @@
 		Py_INCREF(ldict);
 		self->dict = ldict; /* still borrowed */
 
-		if (Py_Type(self)->tp_init != PyBaseObject_Type.tp_init &&
-		    Py_Type(self)->tp_init((PyObject*)self, 
+		if (Py_TYPE(self)->tp_init != PyBaseObject_Type.tp_init &&
+		    Py_TYPE(self)->tp_init((PyObject*)self, 
 					   self->args, self->kw) < 0) {
 			/* we need to get rid of ldict from thread so
 			   we create a new one the next time we do an attr
@@ -386,7 +386,7 @@
 	if (ldict == NULL) 
 		return NULL;
 
-	if (Py_Type(self) != &localtype)
+	if (Py_TYPE(self) != &localtype)
 		/* use generic lookup for subtypes */
 		return PyObject_GenericGetAttr((PyObject *)self, name);
 

Modified: python/branches/py3k/Modules/timemodule.c
==============================================================================
--- python/branches/py3k/Modules/timemodule.c	(original)
+++ python/branches/py3k/Modules/timemodule.c	Wed Dec 19 03:45:37 2007
@@ -365,7 +365,7 @@
 		t = args;
 		Py_INCREF(t);
 	}
-	else if (Py_Type(args) == &StructTimeType) {
+	else if (Py_TYPE(args) == &StructTimeType) {
 		t = structtime_totuple(args);
 	}
 	else {

Modified: python/branches/py3k/Modules/unicodedata.c
==============================================================================
--- python/branches/py3k/Modules/unicodedata.c	(original)
+++ python/branches/py3k/Modules/unicodedata.c	Wed Dec 19 03:45:37 2007
@@ -1187,7 +1187,7 @@
 {
     PyObject *m, *v;
 
-    Py_Type(&UCD_Type) = &PyType_Type;
+    Py_TYPE(&UCD_Type) = &PyType_Type;
 
     m = Py_InitModule3(
         "unicodedata", unicodedata_functions, unicodedata_docstring);

Modified: python/branches/py3k/Modules/xxmodule.c
==============================================================================
--- python/branches/py3k/Modules/xxmodule.c	(original)
+++ python/branches/py3k/Modules/xxmodule.c	Wed Dec 19 03:45:37 2007
@@ -25,7 +25,7 @@
 
 static PyTypeObject Xxo_Type;
 
-#define XxoObject_Check(v)	(Py_Type(v) == &Xxo_Type)
+#define XxoObject_Check(v)	(Py_TYPE(v) == &Xxo_Type)
 
 static XxoObject *
 newXxoObject(PyObject *arg)

Modified: python/branches/py3k/Modules/zipimport.c
==============================================================================
--- python/branches/py3k/Modules/zipimport.c	(original)
+++ python/branches/py3k/Modules/zipimport.c	Wed Dec 19 03:45:37 2007
@@ -171,7 +171,7 @@
 	Py_XDECREF(self->archive);
 	Py_XDECREF(self->prefix);
 	Py_XDECREF(self->files);
-	Py_Type(self)->tp_free((PyObject *)self);
+	Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static PyObject *

Modified: python/branches/py3k/Modules/zlibmodule.c
==============================================================================
--- python/branches/py3k/Modules/zlibmodule.c	(original)
+++ python/branches/py3k/Modules/zlibmodule.c	Wed Dec 19 03:45:37 2007
@@ -1012,8 +1012,8 @@
 PyInit_zlib(void)
 {
     PyObject *m, *ver;
-    Py_Type(&Comptype) = &PyType_Type;
-    Py_Type(&Decomptype) = &PyType_Type;
+    Py_TYPE(&Comptype) = &PyType_Type;
+    Py_TYPE(&Decomptype) = &PyType_Type;
     m = Py_InitModule4("zlib", zlib_methods,
 		       zlib_module_documentation,
 		       (PyObject*)NULL,PYTHON_API_VERSION);

Modified: python/branches/py3k/Objects/abstract.c
==============================================================================
--- python/branches/py3k/Objects/abstract.c	(original)
+++ python/branches/py3k/Objects/abstract.c	Wed Dec 19 03:45:37 2007
@@ -343,7 +343,7 @@
 	if (!PyObject_CheckBuffer(obj)) {
 		PyErr_Format(PyExc_TypeError,
                              "'%100s' does not have the buffer interface",
-                             Py_Type(obj)->tp_name);
+                             Py_TYPE(obj)->tp_name);
 		return -1;
 	}
 	return (*(obj->ob_type->tp_as_buffer->bf_getbuffer))(obj, view, flags);

Modified: python/branches/py3k/Objects/bytesobject.c
==============================================================================
--- python/branches/py3k/Objects/bytesobject.c	(original)
+++ python/branches/py3k/Objects/bytesobject.c	Wed Dec 19 03:45:37 2007
@@ -20,7 +20,7 @@
     if (nullbytes == NULL)
         return 0;
     nullbytes->ob_bytes = NULL;
-    Py_Size(nullbytes) = nullbytes->ob_alloc = 0;
+    Py_SIZE(nullbytes) = nullbytes->ob_alloc = 0;
     nullbytes->ob_exports = 0;
     return 1;
 }
@@ -62,7 +62,7 @@
                 ptr = "";
         else
                 ptr = obj->ob_bytes;
-        ret = PyBuffer_FillInfo(view, ptr, Py_Size(obj), 0, flags);
+        ret = PyBuffer_FillInfo(view, ptr, Py_SIZE(obj), 0, flags);
         if (ret >= 0) {
                 obj->ob_exports++;
         }
@@ -78,13 +78,13 @@
 static Py_ssize_t
 _getbuffer(PyObject *obj, Py_buffer *view)
 {
-    PyBufferProcs *buffer = Py_Type(obj)->tp_as_buffer;
+    PyBufferProcs *buffer = Py_TYPE(obj)->tp_as_buffer;
 
     if (buffer == NULL || buffer->bf_getbuffer == NULL)
     {
         PyErr_Format(PyExc_TypeError,
                      "Type %.100s doesn't support the buffer API",
-                     Py_Type(obj)->tp_name);
+                     Py_TYPE(obj)->tp_name);
         return -1;
     }
 
@@ -129,7 +129,7 @@
             memcpy(new->ob_bytes, bytes, size);
         new->ob_bytes[size] = '\0';  /* Trailing null byte */
     }
-    Py_Size(new) = size;
+    Py_SIZE(new) = size;
     new->ob_alloc = alloc;
     new->ob_exports = 0;
 
@@ -170,7 +170,7 @@
     }
     else if (size < alloc) {
         /* Within allocated size; quick exit */
-        Py_Size(self) = size;
+        Py_SIZE(self) = size;
         ((PyBytesObject *)self)->ob_bytes[size] = '\0'; /* Trailing null */
         return 0;
     }
@@ -200,7 +200,7 @@
     }
 
     ((PyBytesObject *)self)->ob_bytes = sval;
-    Py_Size(self) = size;
+    Py_SIZE(self) = size;
     ((PyBytesObject *)self)->ob_alloc = alloc;
     ((PyBytesObject *)self)->ob_bytes[size] = '\0'; /* Trailing null byte */
 
@@ -219,7 +219,7 @@
     if (_getbuffer(a, &va) < 0  ||
         _getbuffer(b, &vb) < 0) {
             PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
-                         Py_Type(a)->tp_name, Py_Type(b)->tp_name);
+                         Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
             goto done;
     }
 
@@ -248,7 +248,7 @@
 static Py_ssize_t
 bytes_length(PyBytesObject *self)
 {
-    return Py_Size(self);
+    return Py_SIZE(self);
 }
 
 static PyObject *
@@ -260,19 +260,19 @@
 
     if (_getbuffer(other, &vo) < 0) {
         PyErr_Format(PyExc_TypeError, "can't concat bytes to %.100s",
-                     Py_Type(self)->tp_name);
+                     Py_TYPE(self)->tp_name);
         return NULL;
     }
 
-    mysize = Py_Size(self);
+    mysize = Py_SIZE(self);
     size = mysize + vo.len;
     if (size < 0) {
         PyObject_ReleaseBuffer(other, &vo);
         return PyErr_NoMemory();
     }
     if (size < self->ob_alloc) {
-        Py_Size(self) = size;
-        self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
+        Py_SIZE(self) = size;
+        self->ob_bytes[Py_SIZE(self)] = '\0'; /* Trailing null byte */
     }
     else if (PyBytes_Resize((PyObject *)self, size) < 0) {
         PyObject_ReleaseBuffer(other, &vo);
@@ -293,7 +293,7 @@
 
     if (count < 0)
         count = 0;
-    mysize = Py_Size(self);
+    mysize = Py_SIZE(self);
     size = mysize * count;
     if (count != 0 && size / count != mysize)
         return PyErr_NoMemory();
@@ -318,13 +318,13 @@
 
     if (count < 0)
         count = 0;
-    mysize = Py_Size(self);
+    mysize = Py_SIZE(self);
     size = mysize * count;
     if (count != 0 && size / count != mysize)
         return PyErr_NoMemory();
     if (size < self->ob_alloc) {
-        Py_Size(self) = size;
-        self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
+        Py_SIZE(self) = size;
+        self->ob_bytes[Py_SIZE(self)] = '\0'; /* Trailing null byte */
     }
     else if (PyBytes_Resize((PyObject *)self, size) < 0)
         return NULL;
@@ -345,8 +345,8 @@
 bytes_getitem(PyBytesObject *self, Py_ssize_t i)
 {
     if (i < 0)
-        i += Py_Size(self);
-    if (i < 0 || i >= Py_Size(self)) {
+        i += Py_SIZE(self);
+    if (i < 0 || i >= Py_SIZE(self)) {
         PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
         return NULL;
     }
@@ -365,7 +365,7 @@
         if (i < 0)
             i += PyBytes_GET_SIZE(self);
 
-        if (i < 0 || i >= Py_Size(self)) {
+        if (i < 0 || i >= Py_SIZE(self)) {
             PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
             return NULL;
         }
@@ -437,7 +437,7 @@
             if (_getbuffer(values, &vbytes) < 0) {
                     PyErr_Format(PyExc_TypeError,
                                  "can't set bytes slice from %.100s",
-                                 Py_Type(values)->tp_name);
+                                 Py_TYPE(values)->tp_name);
                     return -1;
             }
             needed = vbytes.len;
@@ -448,8 +448,8 @@
         lo = 0;
     if (hi < lo)
         hi = lo;
-    if (hi > Py_Size(self))
-        hi = Py_Size(self);
+    if (hi > Py_SIZE(self))
+        hi = Py_SIZE(self);
 
     avail = hi - lo;
     if (avail < 0)
@@ -464,11 +464,11 @@
               0   lo      new_hi              new_size
             */
             memmove(self->ob_bytes + lo + needed, self->ob_bytes + hi,
-                    Py_Size(self) - hi);
+                    Py_SIZE(self) - hi);
         }
         /* XXX(nnorwitz): need to verify this can't overflow! */
         if (PyBytes_Resize((PyObject *)self,
-                           Py_Size(self) + needed - avail) < 0) {
+                           Py_SIZE(self) + needed - avail) < 0) {
                 res = -1;
                 goto finish;
         }
@@ -480,7 +480,7 @@
               0   lo            new_hi              new_size
              */
             memmove(self->ob_bytes + lo + needed, self->ob_bytes + hi,
-                    Py_Size(self) - lo - needed);
+                    Py_SIZE(self) - lo - needed);
         }
     }
 
@@ -500,9 +500,9 @@
     Py_ssize_t ival;
 
     if (i < 0)
-        i += Py_Size(self);
+        i += Py_SIZE(self);
 
-    if (i < 0 || i >= Py_Size(self)) {
+    if (i < 0 || i >= Py_SIZE(self)) {
         PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
         return -1;
     }
@@ -538,7 +538,7 @@
         if (i < 0)
             i += PyBytes_GET_SIZE(self);
 
-        if (i < 0 || i >= Py_Size(self)) {
+        if (i < 0 || i >= Py_SIZE(self)) {
             PyErr_SetString(PyExc_IndexError, "bytearray index out of range");
             return -1;
         }
@@ -592,7 +592,7 @@
     else {
         assert(PyBytes_Check(values));
         bytes = ((PyBytesObject *)values)->ob_bytes;
-        needed = Py_Size(values);
+        needed = Py_SIZE(values);
     }
     /* Make sure b[5:2] = ... inserts before 5, not before 2. */
     if ((step < 0 && start < stop) ||
@@ -608,10 +608,10 @@
                   0   lo      new_hi              new_size
                 */
                 memmove(self->ob_bytes + start + needed, self->ob_bytes + stop,
-                        Py_Size(self) - stop);
+                        Py_SIZE(self) - stop);
             }
             if (PyBytes_Resize((PyObject *)self,
-                               Py_Size(self) + needed - slicelen) < 0)
+                               Py_SIZE(self) + needed - slicelen) < 0)
                 return -1;
             if (slicelen < needed) {
                 /*
@@ -621,7 +621,7 @@
                   0   lo            new_hi              new_size
                  */
                 memmove(self->ob_bytes + start + needed, self->ob_bytes + stop,
-                        Py_Size(self) - start - needed);
+                        Py_SIZE(self) - start - needed);
             }
         }
 
@@ -692,7 +692,7 @@
     PyObject *it;
     PyObject *(*iternext)(PyObject *);
 
-    if (Py_Size(self) != 0) {
+    if (Py_SIZE(self) != 0) {
         /* Empty previous contents (yes, do this first of all!) */
         if (PyBytes_Resize((PyObject *)self, 0) < 0)
             return -1;
@@ -780,7 +780,7 @@
     it = PyObject_GetIter(arg);
     if (it == NULL)
         return -1;
-    iternext = *Py_Type(it)->tp_iternext;
+    iternext = *Py_TYPE(it)->tp_iternext;
 
     /* Run the iterator to exhaustion */
     for (;;) {
@@ -812,11 +812,11 @@
         }
 
         /* Append the byte */
-        if (Py_Size(self) < self->ob_alloc)
-            Py_Size(self)++;
-        else if (PyBytes_Resize((PyObject *)self, Py_Size(self)+1) < 0)
+        if (Py_SIZE(self) < self->ob_alloc)
+            Py_SIZE(self)++;
+        else if (PyBytes_Resize((PyObject *)self, Py_SIZE(self)+1) < 0)
             goto error;
-        self->ob_bytes[Py_Size(self)-1] = value;
+        self->ob_bytes[Py_SIZE(self)-1] = value;
     }
 
     /* Clean up and return success */
@@ -837,7 +837,7 @@
     static const char *hexdigits = "0123456789abcdef";
     const char *quote_prefix = "bytearray(b";
     const char *quote_postfix = ")";
-    Py_ssize_t length = Py_Size(self);
+    Py_ssize_t length = Py_SIZE(self);
     /* 14 == strlen(quote_prefix) + 2 + strlen(quote_postfix) */
     size_t newsize = 14 + 4 * length;
     PyObject *v;
@@ -1008,7 +1008,7 @@
     if (self->ob_bytes != 0) {
         PyMem_Free(self->ob_bytes);
     }
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 
@@ -1196,7 +1196,7 @@
         PyErr_Clear();
         if (_getbuffer(arg, &varg) < 0)
             return -1;
-        pos = stringlib_find(PyBytes_AS_STRING(self), Py_Size(self),
+        pos = stringlib_find(PyBytes_AS_STRING(self), Py_SIZE(self),
                              varg.buf, varg.len, 0);
         PyObject_ReleaseBuffer(arg, &varg);
         return pos >= 0;
@@ -1206,7 +1206,7 @@
         return -1;
     }
 
-    return memchr(PyBytes_AS_STRING(self), ival, Py_Size(self)) != NULL;
+    return memchr(PyBytes_AS_STRING(self), ival, Py_SIZE(self)) != NULL;
 }
 
 
@@ -2109,7 +2109,7 @@
     count++; }
 
 /* Always force the list to the expected size. */
-#define FIX_PREALLOC_SIZE(list) Py_Size(list) = count
+#define FIX_PREALLOC_SIZE(list) Py_SIZE(list) = count
 
 
 Py_LOCAL_INLINE(PyObject *)
@@ -2495,7 +2495,7 @@
 bytes_reverse(PyBytesObject *self, PyObject *unused)
 {
     char swap, *head, *tail;
-    Py_ssize_t i, j, n = Py_Size(self);
+    Py_ssize_t i, j, n = Py_SIZE(self);
 
     j = n / 2;
     head = self->ob_bytes;
@@ -2517,7 +2517,7 @@
 bytes_insert(PyBytesObject *self, PyObject *args)
 {
     int value;
-    Py_ssize_t where, n = Py_Size(self);
+    Py_ssize_t where, n = Py_SIZE(self);
 
     if (!PyArg_ParseTuple(args, "ni:insert", &where, &value))
         return NULL;
@@ -2556,7 +2556,7 @@
 bytes_append(PyBytesObject *self, PyObject *arg)
 {
     int value;
-    Py_ssize_t n = Py_Size(self);
+    Py_ssize_t n = Py_SIZE(self);
 
     if (! _getbytevalue(arg, &value))
         return NULL;
@@ -2588,7 +2588,7 @@
 
     /* bytes_setslice code only accepts something supporting PEP 3118. */
     if (PyObject_CheckBuffer(arg)) {
-        if (bytes_setslice(self, Py_Size(self), Py_Size(self), arg) == -1)
+        if (bytes_setslice(self, Py_SIZE(self), Py_SIZE(self), arg) == -1)
             return NULL;
 
         Py_RETURN_NONE;
@@ -2642,7 +2642,7 @@
 bytes_pop(PyBytesObject *self, PyObject *args)
 {
     int value;
-    Py_ssize_t where = -1, n = Py_Size(self);
+    Py_ssize_t where = -1, n = Py_SIZE(self);
 
     if (!PyArg_ParseTuple(args, "|n:pop", &where))
         return NULL;
@@ -2653,8 +2653,8 @@
         return NULL;
     }
     if (where < 0)
-        where += Py_Size(self);
-    if (where < 0 || where >= Py_Size(self)) {
+        where += Py_SIZE(self);
+    if (where < 0 || where >= Py_SIZE(self)) {
         PyErr_SetString(PyExc_IndexError, "pop index out of range");
         return NULL;
     }
@@ -2675,7 +2675,7 @@
 bytes_remove(PyBytesObject *self, PyObject *arg)
 {
     int value;
-    Py_ssize_t where, n = Py_Size(self);
+    Py_ssize_t where, n = Py_SIZE(self);
 
     if (! _getbytevalue(arg, &value))
         return NULL;
@@ -2743,7 +2743,7 @@
         argsize = varg.len;
     }
     myptr = self->ob_bytes;
-    mysize = Py_Size(self);
+    mysize = Py_SIZE(self);
     left = lstrip_helper(myptr, mysize, argptr, argsize);
     if (left == mysize)
         right = left;
@@ -2779,7 +2779,7 @@
         argsize = varg.len;
     }
     myptr = self->ob_bytes;
-    mysize = Py_Size(self);
+    mysize = Py_SIZE(self);
     left = lstrip_helper(myptr, mysize, argptr, argsize);
     right = mysize;
     if (arg != Py_None)
@@ -2812,7 +2812,7 @@
         argsize = varg.len;
     }
     myptr = self->ob_bytes;
-    mysize = Py_Size(self);
+    mysize = Py_SIZE(self);
     left = 0;
     right = rstrip_helper(myptr, mysize, argptr, argsize);
     if (arg != Py_None)
@@ -2863,7 +2863,7 @@
 bytes_join(PyBytesObject *self, PyObject *it)
 {
     PyObject *seq;
-    Py_ssize_t mysize = Py_Size(self);
+    Py_ssize_t mysize = Py_SIZE(self);
     Py_ssize_t i;
     Py_ssize_t n;
     PyObject **items;
@@ -2886,12 +2886,12 @@
                          "can only join an iterable of bytes "
                          "(item %ld has type '%.100s')",
                          /* XXX %ld isn't right on Win64 */
-                         (long)i, Py_Type(obj)->tp_name);
+                         (long)i, Py_TYPE(obj)->tp_name);
             goto error;
         }
         if (i > 0)
             totalsize += mysize;
-        totalsize += Py_Size(obj);
+        totalsize += Py_SIZE(obj);
         if (totalsize < 0) {
             PyErr_NoMemory();
             goto error;
@@ -2905,7 +2905,7 @@
     dest = PyBytes_AS_STRING(result);
     for (i = 0; i < n; i++) {
         PyObject *obj = items[i];
-        Py_ssize_t size = Py_Size(obj);
+        Py_ssize_t size = Py_SIZE(obj);
         char *buf;
         if (PyBytes_Check(obj))
            buf = PyBytes_AS_STRING(obj);
@@ -3004,7 +3004,7 @@
     PyObject *latin1, *dict;
     if (self->ob_bytes)
         latin1 = PyUnicode_DecodeLatin1(self->ob_bytes,
-                                        Py_Size(self), NULL);
+                                        Py_SIZE(self), NULL);
     else
         latin1 = PyUnicode_FromString("");
 
@@ -3015,7 +3015,7 @@
         Py_INCREF(dict);
     }
 
-    return Py_BuildValue("(O(Ns)N)", Py_Type(self), latin1, "latin-1", dict);
+    return Py_BuildValue("(O(Ns)N)", Py_TYPE(self), latin1, "latin-1", dict);
 }
 
 static PySequenceMethods bytes_as_sequence = {

Modified: python/branches/py3k/Objects/classobject.c
==============================================================================
--- python/branches/py3k/Objects/classobject.c	(original)
+++ python/branches/py3k/Objects/classobject.c	Wed Dec 19 03:45:37 2007
@@ -208,7 +208,7 @@
 {
 	PyObject *self = a->im_self;
 	PyObject *func = a->im_func;
-	PyObject *klass = (PyObject*)Py_Type(self);
+	PyObject *klass = (PyObject*)Py_TYPE(self);
 	PyObject *funcname = NULL ,*klassname = NULL, *result = NULL;
 	char *defname = "?";
 

Modified: python/branches/py3k/Objects/dictobject.c
==============================================================================
--- python/branches/py3k/Objects/dictobject.c	(original)
+++ python/branches/py3k/Objects/dictobject.c	Wed Dec 19 03:45:37 2007
@@ -203,7 +203,7 @@
 	if (num_free_dicts) {
 		mp = free_dicts[--num_free_dicts];
 		assert (mp != NULL);
-		assert (Py_Type(mp) == &PyDict_Type);
+		assert (Py_TYPE(mp) == &PyDict_Type);
 		_Py_NewReference((PyObject *)mp);
 		if (mp->ma_fill) {
 			EMPTY_TO_MINSIZE(mp);
@@ -897,10 +897,10 @@
 	}
 	if (mp->ma_table != mp->ma_smalltable)
 		PyMem_DEL(mp->ma_table);
-	if (num_free_dicts < MAXFREEDICTS && Py_Type(mp) == &PyDict_Type)
+	if (num_free_dicts < MAXFREEDICTS && Py_TYPE(mp) == &PyDict_Type)
 		free_dicts[num_free_dicts++] = mp;
 	else
-		Py_Type(mp)->tp_free((PyObject *)mp);
+		Py_TYPE(mp)->tp_free((PyObject *)mp);
 	Py_TRASHCAN_SAFE_END(mp)
 }
 
@@ -1014,7 +1014,7 @@
 			if (missing_str == NULL)
 				missing_str =
 				  PyUnicode_InternFromString("__missing__");
-			missing = _PyType_Lookup(Py_Type(mp), missing_str);
+			missing = _PyType_Lookup(Py_TYPE(mp), missing_str);
 			if (missing != NULL)
 				return PyObject_CallFunctionObjArgs(missing,
 					(PyObject *)mp, key, NULL);

Modified: python/branches/py3k/Objects/enumobject.c
==============================================================================
--- python/branches/py3k/Objects/enumobject.c	(original)
+++ python/branches/py3k/Objects/enumobject.c	Wed Dec 19 03:45:37 2007
@@ -46,7 +46,7 @@
 	Py_XDECREF(en->en_sit);
 	Py_XDECREF(en->en_result);
 	Py_XDECREF(en->en_longindex);
-	Py_Type(en)->tp_free(en);
+	Py_TYPE(en)->tp_free(en);
 }
 
 static int
@@ -108,7 +108,7 @@
 	PyObject *result = en->en_result;
 	PyObject *it = en->en_sit;
 
-	next_item = (*Py_Type(it)->tp_iternext)(it);
+	next_item = (*Py_TYPE(it)->tp_iternext)(it);
 	if (next_item == NULL)
 		return NULL;
 
@@ -237,7 +237,7 @@
 {
 	PyObject_GC_UnTrack(ro);
 	Py_XDECREF(ro->seq);
-	Py_Type(ro)->tp_free(ro);
+	Py_TYPE(ro)->tp_free(ro);
 }
 
 static int

Modified: python/branches/py3k/Objects/exceptions.c
==============================================================================
--- python/branches/py3k/Objects/exceptions.c	(original)
+++ python/branches/py3k/Objects/exceptions.c	Wed Dec 19 03:45:37 2007
@@ -42,7 +42,7 @@
 static int
 BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
 {
-    if (!_PyArg_NoKeywords(Py_Type(self)->tp_name, kwds))
+    if (!_PyArg_NoKeywords(Py_TYPE(self)->tp_name, kwds))
         return -1;
 
     Py_DECREF(self->args);
@@ -68,7 +68,7 @@
 {
     _PyObject_GC_UNTRACK(self);
     BaseException_clear(self);
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static int
@@ -101,7 +101,7 @@
     char *name;
     char *dot;
 
-    name = (char *)Py_Type(self)->tp_name;
+    name = (char *)Py_TYPE(self)->tp_name;
     dot = strrchr(name, '.');
     if (dot != NULL) name = dot+1;
 
@@ -113,9 +113,9 @@
 BaseException_reduce(PyBaseExceptionObject *self)
 {
     if (self->args && self->dict)
-        return PyTuple_Pack(3, Py_Type(self), self->args, self->dict);
+        return PyTuple_Pack(3, Py_TYPE(self), self->args, self->dict);
     else
-        return PyTuple_Pack(2, Py_Type(self), self->args);
+        return PyTuple_Pack(2, Py_TYPE(self), self->args);
 }
 
 /*
@@ -465,7 +465,7 @@
 {
     _PyObject_GC_UNTRACK(self);
     SystemExit_clear(self);
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static int
@@ -570,7 +570,7 @@
 {
     _PyObject_GC_UNTRACK(self);
     EnvironmentError_clear(self);
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static int
@@ -636,9 +636,9 @@
         Py_INCREF(args);
 
     if (self->dict)
-        res = PyTuple_Pack(3, Py_Type(self), args, self->dict);
+        res = PyTuple_Pack(3, Py_TYPE(self), args, self->dict);
     else
-        res = PyTuple_Pack(2, Py_Type(self), args);
+        res = PyTuple_Pack(2, Py_TYPE(self), args);
     Py_DECREF(args);
     return res;
 }
@@ -691,7 +691,7 @@
 {
     _PyObject_GC_UNTRACK(self);
     WindowsError_clear(self);
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static int
@@ -889,7 +889,7 @@
 {
     _PyObject_GC_UNTRACK(self);
     SyntaxError_clear(self);
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static int
@@ -1316,7 +1316,7 @@
 {
     _PyObject_GC_UNTRACK(self);
     UnicodeError_clear(self);
-    Py_Type(self)->tp_free((PyObject *)self);
+    Py_TYPE(self)->tp_free((PyObject *)self);
 }
 
 static int

Modified: python/branches/py3k/Objects/floatobject.c
==============================================================================
--- python/branches/py3k/Objects/floatobject.c	(original)
+++ python/branches/py3k/Objects/floatobject.c	Wed Dec 19 03:45:37 2007
@@ -44,8 +44,8 @@
 	p = &((PyFloatBlock *)p)->objects[0];
 	q = p + N_FLOATOBJECTS;
 	while (--q > p)
-		Py_Type(q) = (struct _typeobject *)(q-1);
-	Py_Type(q) = NULL;
+		Py_TYPE(q) = (struct _typeobject *)(q-1);
+	Py_TYPE(q) = NULL;
 	return p + N_FLOATOBJECTS - 1;
 }
 
@@ -105,7 +105,7 @@
 	}
 	/* Inline PyObject_New */
 	op = free_list;
-	free_list = (PyFloatObject *)Py_Type(op);
+	free_list = (PyFloatObject *)Py_TYPE(op);
 	PyObject_INIT(op, &PyFloat_Type);
 	op->ob_fval = fval;
 	return (PyObject *) op;
@@ -221,11 +221,11 @@
 float_dealloc(PyFloatObject *op)
 {
 	if (PyFloat_CheckExact(op)) {
-		Py_Type(op) = (struct _typeobject *)free_list;
+		Py_TYPE(op) = (struct _typeobject *)free_list;
 		free_list = op;
 	}
 	else
-		Py_Type(op)->tp_free((PyObject *)op);
+		Py_TYPE(op)->tp_free((PyObject *)op);
 }
 
 double
@@ -243,7 +243,7 @@
 		return -1;
 	}
 
-	if ((nb = Py_Type(op)->tp_as_number) == NULL || nb->nb_float == NULL) {
+	if ((nb = Py_TYPE(op)->tp_as_number) == NULL || nb->nb_float == NULL) {
 		PyErr_SetString(PyExc_TypeError, "a float is required");
 		return -1;
 	}
@@ -1088,7 +1088,7 @@
 	if (!PyUnicode_Check(arg)) {
 		PyErr_Format(PyExc_TypeError,
 	     "__getformat__() argument must be string, not %.500s",
-			     Py_Type(arg)->tp_name);
+			     Py_TYPE(arg)->tp_name);
 		return NULL;
 	}
 	s = PyUnicode_AsString(arg);
@@ -1412,7 +1412,7 @@
 		for (i = 0, p = &list->objects[0];
 		     i < N_FLOATOBJECTS;
 		     i++, p++) {
-			if (PyFloat_CheckExact(p) && Py_Refcnt(p) != 0)
+			if (PyFloat_CheckExact(p) && Py_REFCNT(p) != 0)
 				frem++;
 		}
 		next = list->next;
@@ -1423,8 +1423,8 @@
 			     i < N_FLOATOBJECTS;
 			     i++, p++) {
 				if (!PyFloat_CheckExact(p) ||
-				    Py_Refcnt(p) == 0) {
-					Py_Type(p) = (struct _typeobject *)
+				    Py_REFCNT(p) == 0) {
+					Py_TYPE(p) = (struct _typeobject *)
 						free_list;
 					free_list = p;
 				}
@@ -1456,7 +1456,7 @@
 			     i < N_FLOATOBJECTS;
 			     i++, p++) {
 				if (PyFloat_CheckExact(p) &&
-				    Py_Refcnt(p) != 0) {
+				    Py_REFCNT(p) != 0) {
 					char buf[100];
 					format_float(buf, sizeof(buf), p, PREC_STR);
 					/* XXX(twouters) cast refcount to
@@ -1465,7 +1465,7 @@
 					 */
 					fprintf(stderr,
 			     "#   <float at %p, refcnt=%ld, val=%s>\n",
-						p, (long)Py_Refcnt(p), buf);
+						p, (long)Py_REFCNT(p), buf);
 				}
 			}
 			list = list->next;

Modified: python/branches/py3k/Objects/frameobject.c
==============================================================================
--- python/branches/py3k/Objects/frameobject.c	(original)
+++ python/branches/py3k/Objects/frameobject.c	Wed Dec 19 03:45:37 2007
@@ -630,7 +630,7 @@
 		    --numfree;
 		    f = free_list;
 		    free_list = free_list->f_back;
-		    if (Py_Size(f) < extras) {
+		    if (Py_SIZE(f) < extras) {
 			    f = PyObject_GC_Resize(PyFrameObject, f, extras);
 			    if (f == NULL) {
 				    Py_DECREF(builtins);

Modified: python/branches/py3k/Objects/funcobject.c
==============================================================================
--- python/branches/py3k/Objects/funcobject.c	(original)
+++ python/branches/py3k/Objects/funcobject.c	Wed Dec 19 03:45:37 2007
@@ -721,7 +721,7 @@
 {
 	_PyObject_GC_UNTRACK((PyObject *)cm);
 	Py_XDECREF(cm->cm_callable);
-	Py_Type(cm)->tp_free((PyObject *)cm);
+	Py_TYPE(cm)->tp_free((PyObject *)cm);
 }
 
 static int
@@ -750,7 +750,7 @@
 		return NULL;
 	}
 	if (type == NULL)
-		type = (PyObject *)(Py_Type(obj));
+		type = (PyObject *)(Py_TYPE(obj));
  	return PyMethod_New(cm->cm_callable, type);
 }
 
@@ -877,7 +877,7 @@
 {
 	_PyObject_GC_UNTRACK((PyObject *)sm);
 	Py_XDECREF(sm->sm_callable);
-	Py_Type(sm)->tp_free((PyObject *)sm);
+	Py_TYPE(sm)->tp_free((PyObject *)sm);
 }
 
 static int

Modified: python/branches/py3k/Objects/genobject.c
==============================================================================
--- python/branches/py3k/Objects/genobject.c	(original)
+++ python/branches/py3k/Objects/genobject.c	Wed Dec 19 03:45:37 2007
@@ -28,7 +28,7 @@
 
 	if (gen->gi_frame != NULL && gen->gi_frame->f_stacktop != NULL) {
 		/* Generator is paused, so we need to close */
-		Py_Type(gen)->tp_del(self);
+		Py_TYPE(gen)->tp_del(self);
 		if (self->ob_refcnt > 0)
 			return;		/* resurrected.  :( */
 	}

Modified: python/branches/py3k/Objects/iterobject.c
==============================================================================
--- python/branches/py3k/Objects/iterobject.c	(original)
+++ python/branches/py3k/Objects/iterobject.c	Wed Dec 19 03:45:37 2007
@@ -253,7 +253,7 @@
         
         assert(PyTuple_Check(args));
 
-	if (Py_Type(&PyZipIter_Type) == NULL) {
+	if (Py_TYPE(&PyZipIter_Type) == NULL) {
 		if (PyType_Ready(&PyZipIter_Type) < 0)
 			return NULL;
 	}

Modified: python/branches/py3k/Objects/listobject.c
==============================================================================
--- python/branches/py3k/Objects/listobject.c	(original)
+++ python/branches/py3k/Objects/listobject.c	Wed Dec 19 03:45:37 2007
@@ -34,7 +34,7 @@
 	*/
 	if (allocated >= newsize && newsize >= (allocated >> 1)) {
 		assert(self->ob_item != NULL || newsize == 0);
-		Py_Size(self) = newsize;
+		Py_SIZE(self) = newsize;
 		return 0;
 	}
 
@@ -58,7 +58,7 @@
 		return -1;
 	}
 	self->ob_item = items;
-	Py_Size(self) = newsize;
+	Py_SIZE(self) = newsize;
 	self->allocated = new_allocated;
 	return 0;
 }
@@ -114,7 +114,7 @@
 		}
 		memset(op->ob_item, 0, nbytes);
 	}
-	Py_Size(op) = size;
+	Py_SIZE(op) = size;
 	op->allocated = size;
 	_PyObject_GC_TRACK(op);
 	return (PyObject *) op;
@@ -128,7 +128,7 @@
 		return -1;
 	}
 	else
-		return Py_Size(op);
+		return Py_SIZE(op);
 }
 
 static PyObject *indexerr = NULL;
@@ -140,7 +140,7 @@
 		PyErr_BadInternalCall();
 		return NULL;
 	}
-	if (i < 0 || i >= Py_Size(op)) {
+	if (i < 0 || i >= Py_SIZE(op)) {
 		if (indexerr == NULL)
 			indexerr = PyUnicode_FromString(
 				"list index out of range");
@@ -161,7 +161,7 @@
 		PyErr_BadInternalCall();
 		return -1;
 	}
-	if (i < 0 || i >= Py_Size(op)) {
+	if (i < 0 || i >= Py_SIZE(op)) {
 		Py_XDECREF(newitem);
 		PyErr_SetString(PyExc_IndexError,
 				"list assignment index out of range");
@@ -177,7 +177,7 @@
 static int
 ins1(PyListObject *self, Py_ssize_t where, PyObject *v)
 {
-	Py_ssize_t i, n = Py_Size(self);
+	Py_ssize_t i, n = Py_SIZE(self);
 	PyObject **items;
 	if (v == NULL) {
 		PyErr_BadInternalCall();
@@ -259,7 +259,7 @@
 		   There's a simple test case where somehow this reduces
 		   thrashing when a *very* large list is created and
 		   immediately deleted. */
-		i = Py_Size(op);
+		i = Py_SIZE(op);
 		while (--i >= 0) {
 			Py_XDECREF(op->ob_item[i]);
 		}
@@ -268,7 +268,7 @@
 	if (num_free_lists < MAXFREELISTS && PyList_CheckExact(op))
 		free_lists[num_free_lists++] = op;
 	else
-		Py_Type(op)->tp_free((PyObject *)op);
+		Py_TYPE(op)->tp_free((PyObject *)op);
 	Py_TRASHCAN_SAFE_END(op)
 }
 
@@ -284,7 +284,7 @@
 		return i > 0 ? PyUnicode_FromString("[...]") : NULL;
 	}
 
-	if (Py_Size(v) == 0) {
+	if (Py_SIZE(v) == 0) {
 		result = PyUnicode_FromString("[]");
 		goto Done;
 	}
@@ -295,7 +295,7 @@
 
 	/* Do repr() on each element.  Note that this may mutate the list,
 	   so must refetch the list size on each iteration. */
-	for (i = 0; i < Py_Size(v); ++i) {
+	for (i = 0; i < Py_SIZE(v); ++i) {
 		int status;
 		if (Py_EnterRecursiveCall(" while getting the repr of a list"))
 			goto Done;
@@ -345,7 +345,7 @@
 static Py_ssize_t
 list_length(PyListObject *a)
 {
-	return Py_Size(a);
+	return Py_SIZE(a);
 }
 
 static int
@@ -354,7 +354,7 @@
 	Py_ssize_t i;
 	int cmp;
 
-	for (i = 0, cmp = 0 ; cmp == 0 && i < Py_Size(a); ++i)
+	for (i = 0, cmp = 0 ; cmp == 0 && i < Py_SIZE(a); ++i)
 		cmp = PyObject_RichCompareBool(el, PyList_GET_ITEM(a, i),
 						   Py_EQ);
 	return cmp;
@@ -363,7 +363,7 @@
 static PyObject *
 list_item(PyListObject *a, Py_ssize_t i)
 {
-	if (i < 0 || i >= Py_Size(a)) {
+	if (i < 0 || i >= Py_SIZE(a)) {
 		if (indexerr == NULL)
 			indexerr = PyUnicode_FromString(
 				"list index out of range");
@@ -382,12 +382,12 @@
 	Py_ssize_t i, len;
 	if (ilow < 0)
 		ilow = 0;
-	else if (ilow > Py_Size(a))
-		ilow = Py_Size(a);
+	else if (ilow > Py_SIZE(a))
+		ilow = Py_SIZE(a);
 	if (ihigh < ilow)
 		ihigh = ilow;
-	else if (ihigh > Py_Size(a))
-		ihigh = Py_Size(a);
+	else if (ihigh > Py_SIZE(a))
+		ihigh = Py_SIZE(a);
 	len = ihigh - ilow;
 	np = (PyListObject *) PyList_New(len);
 	if (np == NULL)
@@ -427,7 +427,7 @@
 		return NULL;
 	}
 #define b ((PyListObject *)bb)
-	size = Py_Size(a) + Py_Size(b);
+	size = Py_SIZE(a) + Py_SIZE(b);
 	if (size < 0)
 		return PyErr_NoMemory();
 	np = (PyListObject *) PyList_New(size);
@@ -436,14 +436,14 @@
 	}
 	src = a->ob_item;
 	dest = np->ob_item;
-	for (i = 0; i < Py_Size(a); i++) {
+	for (i = 0; i < Py_SIZE(a); i++) {
 		PyObject *v = src[i];
 		Py_INCREF(v);
 		dest[i] = v;
 	}
 	src = b->ob_item;
-	dest = np->ob_item + Py_Size(a);
-	for (i = 0; i < Py_Size(b); i++) {
+	dest = np->ob_item + Py_SIZE(a);
+	for (i = 0; i < Py_SIZE(b); i++) {
 		PyObject *v = src[i];
 		Py_INCREF(v);
 		dest[i] = v;
@@ -462,8 +462,8 @@
 	PyObject *elem;
 	if (n < 0)
 		n = 0;
-	size = Py_Size(a) * n;
-	if (n && size/n != Py_Size(a))
+	size = Py_SIZE(a) * n;
+	if (n && size/n != Py_SIZE(a))
 		return PyErr_NoMemory();
 	if (size == 0)
               return PyList_New(0);
@@ -472,7 +472,7 @@
 		return NULL;
 
 	items = np->ob_item;
-	if (Py_Size(a) == 1) {
+	if (Py_SIZE(a) == 1) {
 		elem = a->ob_item[0];
 		for (i = 0; i < n; i++) {
 			items[i] = elem;
@@ -483,7 +483,7 @@
 	p = np->ob_item;
 	items = a->ob_item;
 	for (i = 0; i < n; i++) {
-		for (j = 0; j < Py_Size(a); j++) {
+		for (j = 0; j < Py_SIZE(a); j++) {
 			*p = items[j];
 			Py_INCREF(*p);
 			p++;
@@ -500,8 +500,8 @@
 	if (item != NULL) {
 		/* Because XDECREF can recursively invoke operations on
 		   this list, we make it empty first. */
-		i = Py_Size(a);
-		Py_Size(a) = 0;
+		i = Py_SIZE(a);
+		Py_SIZE(a) = 0;
 		a->ob_item = NULL;
 		a->allocated = 0;
 		while (--i >= 0) {
@@ -547,7 +547,7 @@
 	else {
 		if (a == b) {
 			/* Special case "a[i:j] = a" -- copy b first */
-			v = list_slice(b, 0, Py_Size(b));
+			v = list_slice(b, 0, Py_SIZE(b));
 			if (v == NULL)
 				return result;
 			result = list_ass_slice(a, ilow, ihigh, v);
@@ -562,18 +562,18 @@
 	}
 	if (ilow < 0)
 		ilow = 0;
-	else if (ilow > Py_Size(a))
-		ilow = Py_Size(a);
+	else if (ilow > Py_SIZE(a))
+		ilow = Py_SIZE(a);
 
 	if (ihigh < ilow)
 		ihigh = ilow;
-	else if (ihigh > Py_Size(a))
-		ihigh = Py_Size(a);
+	else if (ihigh > Py_SIZE(a))
+		ihigh = Py_SIZE(a);
 
 	norig = ihigh - ilow;
 	assert(norig >= 0);
 	d = n - norig;
-	if (Py_Size(a) + d == 0) {
+	if (Py_SIZE(a) + d == 0) {
 		Py_XDECREF(v_as_SF);
 		return list_clear(a);
 	}
@@ -591,12 +591,12 @@
 
 	if (d < 0) { /* Delete -d items */
 		memmove(&item[ihigh+d], &item[ihigh],
-			(Py_Size(a) - ihigh)*sizeof(PyObject *));
-		list_resize(a, Py_Size(a) + d);
+			(Py_SIZE(a) - ihigh)*sizeof(PyObject *));
+		list_resize(a, Py_SIZE(a) + d);
 		item = a->ob_item;
 	}
 	else if (d > 0) { /* Insert d items */
-		k = Py_Size(a);
+		k = Py_SIZE(a);
 		if (list_resize(a, k+d) < 0)
 			goto Error;
 		item = a->ob_item;
@@ -671,7 +671,7 @@
 list_ass_item(PyListObject *a, Py_ssize_t i, PyObject *v)
 {
 	PyObject *old_value;
-	if (i < 0 || i >= Py_Size(a)) {
+	if (i < 0 || i >= Py_SIZE(a)) {
 		PyErr_SetString(PyExc_IndexError,
 				"list assignment index out of range");
 		return -1;
@@ -730,7 +730,7 @@
 			Py_DECREF(b);
 			Py_RETURN_NONE;
 		}
-		m = Py_Size(self);
+		m = Py_SIZE(self);
 		if (list_resize(self, m + n) == -1) {
 			Py_DECREF(b);
 			return NULL;
@@ -759,14 +759,14 @@
 
 	/* Guess a result list size. */
 	n = _PyObject_LengthHint(b, 8);
-	m = Py_Size(self);
+	m = Py_SIZE(self);
 	mn = m + n;
 	if (mn >= m) {
 		/* Make room. */
 		if (list_resize(self, mn) == -1)
 			goto error;
 		/* Make the list sane again. */
-		Py_Size(self) = m;
+		Py_SIZE(self) = m;
 	}
 	/* Else m + n overflowed; on the chance that n lied, and there really
 	 * is enough room, ignore it.  If n was telling the truth, we'll
@@ -785,10 +785,10 @@
 			}
 			break;
 		}
-		if (Py_Size(self) < self->allocated) {
+		if (Py_SIZE(self) < self->allocated) {
 			/* steals ref */
-			PyList_SET_ITEM(self, Py_Size(self), item);
-			++Py_Size(self);
+			PyList_SET_ITEM(self, Py_SIZE(self), item);
+			++Py_SIZE(self);
 		}
 		else {
 			int status = app1(self, item);
@@ -799,8 +799,8 @@
 	}
 
 	/* Cut back result list if initial guess was too large. */
-	if (Py_Size(self) < self->allocated)
-		list_resize(self, Py_Size(self));  /* shrinking can't fail */
+	if (Py_SIZE(self) < self->allocated)
+		list_resize(self, Py_SIZE(self));  /* shrinking can't fail */
 
 	Py_DECREF(it);
 	Py_RETURN_NONE;
@@ -839,20 +839,20 @@
 	if (!PyArg_ParseTuple(args, "|n:pop", &i))
 		return NULL;
 
-	if (Py_Size(self) == 0) {
+	if (Py_SIZE(self) == 0) {
 		/* Special-case most common failure cause */
 		PyErr_SetString(PyExc_IndexError, "pop from empty list");
 		return NULL;
 	}
 	if (i < 0)
-		i += Py_Size(self);
-	if (i < 0 || i >= Py_Size(self)) {
+		i += Py_SIZE(self);
+	if (i < 0 || i >= Py_SIZE(self)) {
 		PyErr_SetString(PyExc_IndexError, "pop index out of range");
 		return NULL;
 	}
 	v = self->ob_item[i];
-	if (i == Py_Size(self) - 1) {
-		status = list_resize(self, Py_Size(self) - 1);
+	if (i == Py_SIZE(self) - 1) {
+		status = list_resize(self, Py_SIZE(self) - 1);
 		assert(status >= 0);
 		return v; /* and v now owns the reference the list had */
 	}
@@ -2009,10 +2009,10 @@
 	 * sorting (allowing mutations during sorting is a core-dump
 	 * factory, since ob_item may change).
 	 */
-	saved_ob_size = Py_Size(self);
+	saved_ob_size = Py_SIZE(self);
 	saved_ob_item = self->ob_item;
 	saved_allocated = self->allocated;
-	Py_Size(self) = 0;
+	Py_SIZE(self) = 0;
 	self->ob_item = NULL;
 	self->allocated = -1; /* any operation will reset it to >= 0 */
 
@@ -2118,8 +2118,8 @@
 
 dsu_fail:
 	final_ob_item = self->ob_item;
-	i = Py_Size(self);
-	Py_Size(self) = saved_ob_size;
+	i = Py_SIZE(self);
+	Py_SIZE(self) = saved_ob_size;
 	self->ob_item = saved_ob_item;
 	self->allocated = saved_allocated;
 	if (final_ob_item != NULL) {
@@ -2154,8 +2154,8 @@
 static PyObject *
 listreverse(PyListObject *self)
 {
-	if (Py_Size(self) > 1)
-		reverse_slice(self->ob_item, self->ob_item + Py_Size(self));
+	if (Py_SIZE(self) > 1)
+		reverse_slice(self->ob_item, self->ob_item + Py_SIZE(self));
 	Py_RETURN_NONE;
 }
 
@@ -2168,8 +2168,8 @@
 		PyErr_BadInternalCall();
 		return -1;
 	}
-	if (Py_Size(self) > 1)
-		reverse_slice(self->ob_item, self->ob_item + Py_Size(self));
+	if (Py_SIZE(self) > 1)
+		reverse_slice(self->ob_item, self->ob_item + Py_SIZE(self));
 	return 0;
 }
 
@@ -2183,7 +2183,7 @@
 		PyErr_BadInternalCall();
 		return NULL;
 	}
-	n = Py_Size(v);
+	n = Py_SIZE(v);
 	w = PyTuple_New(n);
 	if (w == NULL)
 		return NULL;
@@ -2201,7 +2201,7 @@
 static PyObject *
 listindex(PyListObject *self, PyObject *args)
 {
-	Py_ssize_t i, start=0, stop=Py_Size(self);
+	Py_ssize_t i, start=0, stop=Py_SIZE(self);
 	PyObject *v;
 
 	if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
@@ -2209,16 +2209,16 @@
 	                            _PyEval_SliceIndex, &stop))
 		return NULL;
 	if (start < 0) {
-		start += Py_Size(self);
+		start += Py_SIZE(self);
 		if (start < 0)
 			start = 0;
 	}
 	if (stop < 0) {
-		stop += Py_Size(self);
+		stop += Py_SIZE(self);
 		if (stop < 0)
 			stop = 0;
 	}
-	for (i = start; i < stop && i < Py_Size(self); i++) {
+	for (i = start; i < stop && i < Py_SIZE(self); i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
 		if (cmp > 0)
 			return PyLong_FromSsize_t(i);
@@ -2235,7 +2235,7 @@
 	Py_ssize_t count = 0;
 	Py_ssize_t i;
 
-	for (i = 0; i < Py_Size(self); i++) {
+	for (i = 0; i < Py_SIZE(self); i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
 		if (cmp > 0)
 			count++;
@@ -2250,7 +2250,7 @@
 {
 	Py_ssize_t i;
 
-	for (i = 0; i < Py_Size(self); i++) {
+	for (i = 0; i < Py_SIZE(self); i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
 		if (cmp > 0) {
 			if (list_ass_slice(self, i, i+1,
@@ -2270,7 +2270,7 @@
 {
 	Py_ssize_t i;
 
-	for (i = Py_Size(o); --i >= 0; )
+	for (i = Py_SIZE(o); --i >= 0; )
 		Py_VISIT(o->ob_item[i]);
 	return 0;
 }
@@ -2289,7 +2289,7 @@
 	vl = (PyListObject *)v;
 	wl = (PyListObject *)w;
 
-	if (Py_Size(vl) != Py_Size(wl) && (op == Py_EQ || op == Py_NE)) {
+	if (Py_SIZE(vl) != Py_SIZE(wl) && (op == Py_EQ || op == Py_NE)) {
 		/* Shortcut: if the lengths differ, the lists differ */
 		PyObject *res;
 		if (op == Py_EQ)
@@ -2301,7 +2301,7 @@
 	}
 
 	/* Search for the first index where items are different */
-	for (i = 0; i < Py_Size(vl) && i < Py_Size(wl); i++) {
+	for (i = 0; i < Py_SIZE(vl) && i < Py_SIZE(wl); i++) {
 		int k = PyObject_RichCompareBool(vl->ob_item[i],
 						 wl->ob_item[i], Py_EQ);
 		if (k < 0)
@@ -2310,10 +2310,10 @@
 			break;
 	}
 
-	if (i >= Py_Size(vl) || i >= Py_Size(wl)) {
+	if (i >= Py_SIZE(vl) || i >= Py_SIZE(wl)) {
 		/* No more items to compare -- compare sizes */
-		Py_ssize_t vs = Py_Size(vl);
-		Py_ssize_t ws = Py_Size(wl);
+		Py_ssize_t vs = Py_SIZE(vl);
+		Py_ssize_t ws = Py_SIZE(wl);
 		int cmp;
 		PyObject *res;
 		switch (op) {
@@ -2357,8 +2357,8 @@
 		return -1;
 
 	/* Verify list invariants established by PyType_GenericAlloc() */
-	assert(0 <= Py_Size(self));
-	assert(Py_Size(self) <= self->allocated || self->allocated == -1);
+	assert(0 <= Py_SIZE(self));
+	assert(Py_SIZE(self) <= self->allocated || self->allocated == -1);
 	assert(self->ob_item != NULL ||
 	       self->allocated == 0 || self->allocated == -1);
 
@@ -2454,7 +2454,7 @@
 		PyObject* it;
 		PyObject **src, **dest;
 
-		if (PySlice_GetIndicesEx((PySliceObject*)item, Py_Size(self),
+		if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
 				 &start, &stop, &step, &slicelength) < 0) {
 			return NULL;
 		}
@@ -2503,7 +2503,7 @@
 	else if (PySlice_Check(item)) {
 		Py_ssize_t start, stop, step, slicelength;
 
-		if (PySlice_GetIndicesEx((PySliceObject*)item, Py_Size(self),
+		if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
 				 &start, &stop, &step, &slicelength) < 0) {
 			return -1;
 		}
@@ -2551,8 +2551,8 @@
 
 				garbage[i] = PyList_GET_ITEM(self, cur);
 
-				if (cur + step >= Py_Size(self)) {
-					lim = Py_Size(self) - cur - 1;
+				if (cur + step >= Py_SIZE(self)) {
+					lim = Py_SIZE(self) - cur - 1;
 				}
 
 				memmove(self->ob_item + cur - i,
@@ -2560,15 +2560,15 @@
 					lim * sizeof(PyObject *));
 			}
 			cur = start + slicelength*step;
-			if (cur < Py_Size(self)) {
+			if (cur < Py_SIZE(self)) {
 				memmove(self->ob_item + cur - slicelength,
 					self->ob_item + cur,
-					(Py_Size(self) - cur) * 
+					(Py_SIZE(self) - cur) * 
 					 sizeof(PyObject *));
 			}
 
-			Py_Size(self) -= slicelength;
-			list_resize(self, Py_Size(self));
+			Py_SIZE(self) -= slicelength;
+			list_resize(self, Py_SIZE(self));
 
 			for (i = 0; i < slicelength; i++) {
 				Py_DECREF(garbage[i]);

Modified: python/branches/py3k/Objects/longobject.c
==============================================================================
--- python/branches/py3k/Objects/longobject.c	(original)
+++ python/branches/py3k/Objects/longobject.c	Wed Dec 19 03:45:37 2007
@@ -48,11 +48,11 @@
 #define CHECK_SMALL_INT(ival)
 #endif
 
-#define MEDIUM_VALUE(x) (Py_Size(x) < 0 ? -(x)->ob_digit[0] : (Py_Size(x) == 0 ? 0 : (x)->ob_digit[0]))
+#define MEDIUM_VALUE(x) (Py_SIZE(x) < 0 ? -(x)->ob_digit[0] : (Py_SIZE(x) == 0 ? 0 : (x)->ob_digit[0]))
 /* If a freshly-allocated long is already shared, it must
    be a small integer, so negating it must go to PyLong_FromLong */
 #define NEGATE(x) \
-	do if (Py_Refcnt(x) == 1) Py_Size(x) = -Py_Size(x);  \
+	do if (Py_REFCNT(x) == 1) Py_SIZE(x) = -Py_SIZE(x);  \
 	   else { PyObject* tmp=PyLong_FromLong(-MEDIUM_VALUE(x));  \
 		   Py_DECREF(x); (x) = (PyLongObject*)tmp; }	   \
         while(0)
@@ -96,13 +96,13 @@
 static PyLongObject *
 long_normalize(register PyLongObject *v)
 {
-	Py_ssize_t j = ABS(Py_Size(v));
+	Py_ssize_t j = ABS(Py_SIZE(v));
 	Py_ssize_t i = j;
 
 	while (i > 0 && v->ob_digit[i-1] == 0)
 		--i;
 	if (i != j)
-		Py_Size(v) = (Py_Size(v) < 0) ? -(i) : i;
+		Py_SIZE(v) = (Py_SIZE(v) < 0) ? -(i) : i;
 	return v;
 }
 
@@ -136,18 +136,18 @@
 	Py_ssize_t i;
 
 	assert(src != NULL);
-	i = Py_Size(src);
+	i = Py_SIZE(src);
 	if (i < 0)
 		i = -(i);
 	if (i < 2) {
 		int ival = src->ob_digit[0];
-		if (Py_Size(src) < 0)
+		if (Py_SIZE(src) < 0)
 			ival = -ival;
 		CHECK_SMALL_INT(ival);
 	}
 	result = _PyLong_New(i);
 	if (result != NULL) {
-		Py_Size(result) = Py_Size(src);
+		Py_SIZE(result) = Py_SIZE(src);
 		while (--i >= 0)
 			result->ob_digit[i] = src->ob_digit[i];
 	}
@@ -175,7 +175,7 @@
 	if (!(ival>>PyLong_SHIFT)) {
 		v = _PyLong_New(1);
 		if (v) {
-			Py_Size(v) = sign;
+			Py_SIZE(v) = sign;
 			v->ob_digit[0] = ival;
 		}
 		return (PyObject*)v;
@@ -185,7 +185,7 @@
 	if (!(ival >> 2*PyLong_SHIFT)) {
 		v = _PyLong_New(2);
 		if (v) {
-			Py_Size(v) = 2*sign;
+			Py_SIZE(v) = 2*sign;
 			v->ob_digit[0] = (digit)ival & PyLong_MASK;
 			v->ob_digit[1] = ival >> PyLong_SHIFT;
 		}
@@ -201,7 +201,7 @@
 	v = _PyLong_New(ndigits);
 	if (v != NULL) {
 		digit *p = v->ob_digit;
-		Py_Size(v) = ndigits*sign;
+		Py_SIZE(v) = ndigits*sign;
 		t = (unsigned long)ival;
 		while (t) {
 			*p++ = (digit)(t & PyLong_MASK);
@@ -231,7 +231,7 @@
 	v = _PyLong_New(ndigits);
 	if (v != NULL) {
 		digit *p = v->ob_digit;
-		Py_Size(v) = ndigits;
+		Py_SIZE(v) = ndigits;
 		while (ival) {
 			*p++ = (digit)(ival & PyLong_MASK);
 			ival >>= PyLong_SHIFT;
@@ -273,7 +273,7 @@
 		frac = ldexp(frac, PyLong_SHIFT);
 	}
 	if (neg)
-		Py_Size(v) = -(Py_Size(v));
+		Py_SIZE(v) = -(Py_SIZE(v));
 	return (PyObject *)v;
 }
 
@@ -330,7 +330,7 @@
 
 	res = -1;
 	v = (PyLongObject *)vv;
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 
 	switch (i) {
 	case -1:
@@ -353,7 +353,7 @@
 			prev = x;
 			x = (x << PyLong_SHIFT) + v->ob_digit[i];
 			if ((x >> PyLong_SHIFT) != prev) {
-				*overflow = Py_Size(v) > 0 ? 1 : -1;
+				*overflow = Py_SIZE(v) > 0 ? 1 : -1;
 				goto exit;
 			}
 		}
@@ -367,7 +367,7 @@
 			res = LONG_MIN;
 		}
 		else {
-			*overflow = Py_Size(v) > 0 ? 1 : -1;
+			*overflow = Py_SIZE(v) > 0 ? 1 : -1;
 			/* res is already set to -1 */
 		}	
 	}
@@ -401,7 +401,7 @@
 		return 0;
 	}
 	/* conservative estimate */
-	size = Py_Size(vv);
+	size = Py_SIZE(vv);
 	return -2 <= size && size <= 2;
 }
 
@@ -420,7 +420,7 @@
 		return -1;
 	}
 	v = (PyLongObject *)vv;
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	switch (i) {
 	case -1: return -v->ob_digit[0];
 	case 0: return 0;
@@ -470,7 +470,7 @@
 		return (unsigned long) -1;
 	}
 	v = (PyLongObject *)vv;
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	x = 0;
 	if (i < 0) {
 		PyErr_SetString(PyExc_OverflowError,
@@ -508,7 +508,7 @@
 		return (unsigned long) -1;
 	}
 	v = (PyLongObject *)vv;
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	x = 0;
 	if (i < 0) {
 		PyErr_SetString(PyExc_OverflowError,
@@ -547,7 +547,7 @@
 		return (unsigned long) -1;
 	}
 	v = (PyLongObject *)vv;
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	switch (i) {
 	case 0: return 0;
 	case 1: return v->ob_digit[0];
@@ -607,7 +607,7 @@
 	assert(v != NULL);
 	assert(PyLong_Check(v));
 
-	return Py_Size(v) == 0 ? 0 : (Py_Size(v) < 0 ? -1 : 1);
+	return Py_SIZE(v) == 0 ? 0 : (Py_SIZE(v) < 0 ? -1 : 1);
 }
 
 size_t
@@ -619,7 +619,7 @@
 
 	assert(v != NULL);
 	assert(PyLong_Check(v));
-	ndigits = ABS(Py_Size(v));
+	ndigits = ABS(Py_SIZE(v));
 	assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0);
 	if (ndigits > 0) {
 		digit msd = v->ob_digit[ndigits - 1];
@@ -745,7 +745,7 @@
 		}
 	}
 
-	Py_Size(v) = is_signed ? -idigit : idigit;
+	Py_SIZE(v) = is_signed ? -idigit : idigit;
 	return (PyObject *)long_normalize(v);
 }
 
@@ -766,8 +766,8 @@
 
 	assert(v != NULL && PyLong_Check(v));
 
-	if (Py_Size(v) < 0) {
-		ndigits = -(Py_Size(v));
+	if (Py_SIZE(v) < 0) {
+		ndigits = -(Py_SIZE(v));
 		if (!is_signed) {
 			PyErr_SetString(PyExc_TypeError,
 				"can't convert negative int to unsigned");
@@ -776,7 +776,7 @@
 		do_twos_comp = 1;
 	}
 	else {
-		ndigits = Py_Size(v);
+		ndigits = Py_SIZE(v);
 		do_twos_comp = 0;
 	}
 
@@ -912,7 +912,7 @@
 		return -1;
 	}
 	v = (PyLongObject *)vv;
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	sign = 1;
 	if (i < 0) {
 		sign = -1;
@@ -1063,7 +1063,7 @@
 	v = _PyLong_New(ndigits);
 	if (v != NULL) {
 		digit *p = v->ob_digit;
-		Py_Size(v) = negative ? -ndigits : ndigits;
+		Py_SIZE(v) = negative ? -ndigits : ndigits;
 		t = (unsigned PY_LONG_LONG)ival;
 		while (t) {
 			*p++ = (digit)(t & PyLong_MASK);
@@ -1093,7 +1093,7 @@
 	v = _PyLong_New(ndigits);
 	if (v != NULL) {
 		digit *p = v->ob_digit;
-		Py_Size(v) = ndigits;
+		Py_SIZE(v) = ndigits;
 		while (ival) {
 			*p++ = (digit)(ival & PyLong_MASK);
 			ival >>= PyLong_SHIFT;
@@ -1167,7 +1167,7 @@
 	}
 
 	v = (PyLongObject*)vv;
-	switch(Py_Size(v)) {
+	switch(Py_SIZE(v)) {
 	case -1: return -v->ob_digit[0];
 	case 0: return 0;
 	case 1: return v->ob_digit[0];
@@ -1200,7 +1200,7 @@
 	}
 
 	v = (PyLongObject*)vv;
-	switch(Py_Size(v)) {
+	switch(Py_SIZE(v)) {
 	case 0: return 0;
 	case 1: return v->ob_digit[0];
 	}
@@ -1232,11 +1232,11 @@
 		return (unsigned long) -1;
 	}
 	v = (PyLongObject *)vv;
-	switch(Py_Size(v)) {
+	switch(Py_SIZE(v)) {
 	case 0: return 0;
 	case 1: return v->ob_digit[0];
 	}
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	sign = 1;
 	x = 0;
 	if (i < 0) {
@@ -1358,7 +1358,7 @@
 static PyLongObject *
 muladd1(PyLongObject *a, wdigit n, wdigit extra)
 {
-	Py_ssize_t size_a = ABS(Py_Size(a));
+	Py_ssize_t size_a = ABS(Py_SIZE(a));
 	PyLongObject *z = _PyLong_New(size_a+1);
 	twodigits carry = extra;
 	Py_ssize_t i;
@@ -1404,7 +1404,7 @@
 static PyLongObject *
 divrem1(PyLongObject *a, digit n, digit *prem)
 {
-	const Py_ssize_t size = ABS(Py_Size(a));
+	const Py_ssize_t size = ABS(Py_SIZE(a));
 	PyLongObject *z;
 
 	assert(n > 0 && n <= PyLong_MASK);
@@ -1435,7 +1435,7 @@
 		return NULL;
 	}
 	assert(base >= 2 && base <= 36);
-	size_a = ABS(Py_Size(a));
+	size_a = ABS(Py_SIZE(a));
 
 	/* Compute a rough upper bound for the length of the string */
 	i = base;
@@ -1457,10 +1457,10 @@
 		return NULL;
 	p = PyUnicode_AS_UNICODE(str) + sz;
 	*p = '\0';
-	if (Py_Size(a) < 0)
+	if (Py_SIZE(a) < 0)
 		sign = '-';
 
-	if (Py_Size(a) == 0) {
+	if (Py_SIZE(a) == 0) {
 		*--p = '0';
 	}
 	else if ((base & (base - 1)) == 0) {
@@ -1853,7 +1853,7 @@
 		z = _PyLong_New(size_z);
 		if (z == NULL)
 			return NULL;
-		Py_Size(z) = 0;
+		Py_SIZE(z) = 0;
 
 		/* `convwidth` consecutive input digits are treated as a single
 		 * digit in base `convmultmax`.
@@ -1883,7 +1883,7 @@
 
 			/* Multiply z by convmult, and add c. */
 			pz = z->ob_digit;
-			pzstop = pz + Py_Size(z);
+			pzstop = pz + Py_SIZE(z);
 			for (; pz < pzstop; ++pz) {
 				c += (twodigits)*pz * convmult;
 				*pz = (digit)(c & PyLong_MASK);
@@ -1892,14 +1892,14 @@
 			/* carry off the current end? */
 			if (c) {
 				assert(c < PyLong_BASE);
-				if (Py_Size(z) < size_z) {
+				if (Py_SIZE(z) < size_z) {
 					*pz = (digit)c;
-					++Py_Size(z);
+					++Py_SIZE(z);
 				}
 				else {
 					PyLongObject *tmp;
 					/* Extremely rare.  Get more space. */
-					assert(Py_Size(z) == size_z);
+					assert(Py_SIZE(z) == size_z);
 					tmp = _PyLong_New(size_z + 1);
 					if (tmp == NULL) {
 						Py_DECREF(z);
@@ -1922,7 +1922,7 @@
 		/* reset the base to 0, else the exception message
 		   doesn't make too much sense */
 		base = 0;
-		if (Py_Size(z) != 0)
+		if (Py_SIZE(z) != 0)
 			goto onError;
 		/* there might still be other problems, therefore base
 		   remains zero here for the same reason */
@@ -1930,7 +1930,7 @@
 	if (str == start)
 		goto onError;
 	if (sign < 0)
-		Py_Size(z) = -(Py_Size(z));
+		Py_SIZE(z) = -(Py_SIZE(z));
 	if (*str == 'L' || *str == 'l')
 		str++;
 	while (*str && isspace(Py_CHARMASK(*str)))
@@ -1985,7 +1985,7 @@
 long_divrem(PyLongObject *a, PyLongObject *b,
 	    PyLongObject **pdiv, PyLongObject **prem)
 {
-	Py_ssize_t size_a = ABS(Py_Size(a)), size_b = ABS(Py_Size(b));
+	Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b));
 	PyLongObject *z;
 
 	if (size_b == 0) {
@@ -2024,9 +2024,9 @@
 	   The quotient z has the sign of a*b;
 	   the remainder r has the sign of a,
 	   so a = b*z + r. */
-	if ((Py_Size(a) < 0) != (Py_Size(b) < 0))
+	if ((Py_SIZE(a) < 0) != (Py_SIZE(b) < 0))
 		NEGATE(z);
-	if (Py_Size(a) < 0 && Py_Size(*prem) != 0)
+	if (Py_SIZE(a) < 0 && Py_SIZE(*prem) != 0)
 		NEGATE(*prem);
 	*pdiv = z;
 	return 0;
@@ -2037,7 +2037,7 @@
 static PyLongObject *
 x_divrem(PyLongObject *v1, PyLongObject *w1, PyLongObject **prem)
 {
-	Py_ssize_t size_v = ABS(Py_Size(v1)), size_w = ABS(Py_Size(w1));
+	Py_ssize_t size_v = ABS(Py_SIZE(v1)), size_w = ABS(Py_SIZE(w1));
 	digit d = (digit) ((twodigits)PyLong_BASE / (w1->ob_digit[size_w-1] + 1));
 	PyLongObject *v = mul1(v1, d);
 	PyLongObject *w = mul1(w1, d);
@@ -2051,10 +2051,10 @@
 	}
 
 	assert(size_v >= size_w && size_w > 1); /* Assert checks by div() */
-	assert(Py_Refcnt(v) == 1); /* Since v will be used as accumulator! */
-	assert(size_w == ABS(Py_Size(w))); /* That's how d was calculated */
+	assert(Py_REFCNT(v) == 1); /* Since v will be used as accumulator! */
+	assert(size_w == ABS(Py_SIZE(w))); /* That's how d was calculated */
 
-	size_v = ABS(Py_Size(v));
+	size_v = ABS(Py_SIZE(v));
 	k = size_v - size_w;
 	a = _PyLong_New(k + 1);
 
@@ -2137,7 +2137,7 @@
 static void
 long_dealloc(PyObject *v)
 {
-	Py_Type(v)->tp_free(v);
+	Py_TYPE(v)->tp_free(v);
 }
 
 static PyObject *
@@ -2151,21 +2151,21 @@
 {
 	Py_ssize_t sign;
 
-	if (Py_Size(a) != Py_Size(b)) {
-		if (ABS(Py_Size(a)) == 0 && ABS(Py_Size(b)) == 0)
+	if (Py_SIZE(a) != Py_SIZE(b)) {
+		if (ABS(Py_SIZE(a)) == 0 && ABS(Py_SIZE(b)) == 0)
 			sign = 0;
 		else
-			sign = Py_Size(a) - Py_Size(b);
+			sign = Py_SIZE(a) - Py_SIZE(b);
 	}
 	else {
-		Py_ssize_t i = ABS(Py_Size(a));
+		Py_ssize_t i = ABS(Py_SIZE(a));
 		while (--i >= 0 && a->ob_digit[i] == b->ob_digit[i])
 			;
 		if (i < 0)
 			sign = 0;
 		else {
 			sign = (int)a->ob_digit[i] - (int)b->ob_digit[i];
-			if (Py_Size(a) < 0)
+			if (Py_SIZE(a) < 0)
 				sign = -sign;
 		}
 	}
@@ -2192,7 +2192,7 @@
 	/* This is designed so that Python ints and longs with the
 	   same value hash to the same value, otherwise comparisons
 	   of mapping keys will turn out weird */
-	i = Py_Size(v);
+	i = Py_SIZE(v);
 	switch(i) {
 	case -1: return v->ob_digit[0]==1 ? -2 : -v->ob_digit[0];
 	case 0: return 0;
@@ -2231,7 +2231,7 @@
 static PyLongObject *
 x_add(PyLongObject *a, PyLongObject *b)
 {
-	Py_ssize_t size_a = ABS(Py_Size(a)), size_b = ABS(Py_Size(b));
+	Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b));
 	PyLongObject *z;
 	int i;
 	digit carry = 0;
@@ -2265,7 +2265,7 @@
 static PyLongObject *
 x_sub(PyLongObject *a, PyLongObject *b)
 {
-	Py_ssize_t size_a = ABS(Py_Size(a)), size_b = ABS(Py_Size(b));
+	Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b));
 	PyLongObject *z;
 	Py_ssize_t i;
 	int sign = 1;
@@ -2322,22 +2322,22 @@
 
 	CHECK_BINOP(a, b);
 
-	if (ABS(Py_Size(a)) <= 1 && ABS(Py_Size(b)) <= 1) {
+	if (ABS(Py_SIZE(a)) <= 1 && ABS(Py_SIZE(b)) <= 1) {
 		PyObject *result = PyLong_FromLong(MEDIUM_VALUE(a) +
 						  MEDIUM_VALUE(b));
 		return result;
 	}
-	if (Py_Size(a) < 0) {
-		if (Py_Size(b) < 0) {
+	if (Py_SIZE(a) < 0) {
+		if (Py_SIZE(b) < 0) {
 			z = x_add(a, b);
-			if (z != NULL && Py_Size(z) != 0)
-				Py_Size(z) = -(Py_Size(z));
+			if (z != NULL && Py_SIZE(z) != 0)
+				Py_SIZE(z) = -(Py_SIZE(z));
 		}
 		else
 			z = x_sub(b, a);
 	}
 	else {
-		if (Py_Size(b) < 0)
+		if (Py_SIZE(b) < 0)
 			z = x_sub(a, b);
 		else
 			z = x_add(a, b);
@@ -2352,21 +2352,21 @@
 
 	CHECK_BINOP(a, b);
 
-	if (ABS(Py_Size(a)) <= 1 && ABS(Py_Size(b)) <= 1) {
+	if (ABS(Py_SIZE(a)) <= 1 && ABS(Py_SIZE(b)) <= 1) {
 		PyObject* r;
 		r = PyLong_FromLong(MEDIUM_VALUE(a)-MEDIUM_VALUE(b));
 		return r;
 	}
-	if (Py_Size(a) < 0) {
-		if (Py_Size(b) < 0)
+	if (Py_SIZE(a) < 0) {
+		if (Py_SIZE(b) < 0)
 			z = x_sub(a, b);
 		else
 			z = x_add(a, b);
-		if (z != NULL && Py_Size(z) != 0)
-			Py_Size(z) = -(Py_Size(z));
+		if (z != NULL && Py_SIZE(z) != 0)
+			Py_SIZE(z) = -(Py_SIZE(z));
 	}
 	else {
-		if (Py_Size(b) < 0)
+		if (Py_SIZE(b) < 0)
 			z = x_add(a, b);
 		else
 			z = x_sub(a, b);
@@ -2381,15 +2381,15 @@
 x_mul(PyLongObject *a, PyLongObject *b)
 {
 	PyLongObject *z;
-	Py_ssize_t size_a = ABS(Py_Size(a));
-	Py_ssize_t size_b = ABS(Py_Size(b));
+	Py_ssize_t size_a = ABS(Py_SIZE(a));
+	Py_ssize_t size_b = ABS(Py_SIZE(b));
 	Py_ssize_t i;
 
      	z = _PyLong_New(size_a + size_b);
 	if (z == NULL)
 		return NULL;
 
-	memset(z->ob_digit, 0, Py_Size(z) * sizeof(digit));
+	memset(z->ob_digit, 0, Py_SIZE(z) * sizeof(digit));
 	if (a == b) {
 		/* Efficient squaring per HAC, Algorithm 14.16:
 		 * http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf
@@ -2473,7 +2473,7 @@
 {
 	PyLongObject *hi, *lo;
 	Py_ssize_t size_lo, size_hi;
-	const Py_ssize_t size_n = ABS(Py_Size(n));
+	const Py_ssize_t size_n = ABS(Py_SIZE(n));
 
 	size_lo = MIN(size_n, size);
 	size_hi = size_n - size_lo;
@@ -2502,8 +2502,8 @@
 static PyLongObject *
 k_mul(PyLongObject *a, PyLongObject *b)
 {
-	Py_ssize_t asize = ABS(Py_Size(a));
-	Py_ssize_t bsize = ABS(Py_Size(b));
+	Py_ssize_t asize = ABS(Py_SIZE(a));
+	Py_ssize_t bsize = ABS(Py_SIZE(b));
 	PyLongObject *ah = NULL;
 	PyLongObject *al = NULL;
 	PyLongObject *bh = NULL;
@@ -2555,7 +2555,7 @@
 	/* Split a & b into hi & lo pieces. */
 	shift = bsize >> 1;
 	if (kmul_split(a, shift, &ah, &al) < 0) goto fail;
-	assert(Py_Size(ah) > 0);	/* the split isn't degenerate */
+	assert(Py_SIZE(ah) > 0);	/* the split isn't degenerate */
 
 	if (a == b) {
 		bh = ah;
@@ -2586,20 +2586,20 @@
 	if (ret == NULL) goto fail;
 #ifdef Py_DEBUG
 	/* Fill with trash, to catch reference to uninitialized digits. */
-	memset(ret->ob_digit, 0xDF, Py_Size(ret) * sizeof(digit));
+	memset(ret->ob_digit, 0xDF, Py_SIZE(ret) * sizeof(digit));
 #endif
 
 	/* 2. t1 <- ah*bh, and copy into high digits of result. */
 	if ((t1 = k_mul(ah, bh)) == NULL) goto fail;
-	assert(Py_Size(t1) >= 0);
-	assert(2*shift + Py_Size(t1) <= Py_Size(ret));
+	assert(Py_SIZE(t1) >= 0);
+	assert(2*shift + Py_SIZE(t1) <= Py_SIZE(ret));
 	memcpy(ret->ob_digit + 2*shift, t1->ob_digit,
-	       Py_Size(t1) * sizeof(digit));
+	       Py_SIZE(t1) * sizeof(digit));
 
 	/* Zero-out the digits higher than the ah*bh copy. */
-	i = Py_Size(ret) - 2*shift - Py_Size(t1);
+	i = Py_SIZE(ret) - 2*shift - Py_SIZE(t1);
 	if (i)
-		memset(ret->ob_digit + 2*shift + Py_Size(t1), 0,
+		memset(ret->ob_digit + 2*shift + Py_SIZE(t1), 0,
 		       i * sizeof(digit));
 
 	/* 3. t2 <- al*bl, and copy into the low digits. */
@@ -2607,23 +2607,23 @@
 		Py_DECREF(t1);
 		goto fail;
 	}
-	assert(Py_Size(t2) >= 0);
-	assert(Py_Size(t2) <= 2*shift); /* no overlap with high digits */
-	memcpy(ret->ob_digit, t2->ob_digit, Py_Size(t2) * sizeof(digit));
+	assert(Py_SIZE(t2) >= 0);
+	assert(Py_SIZE(t2) <= 2*shift); /* no overlap with high digits */
+	memcpy(ret->ob_digit, t2->ob_digit, Py_SIZE(t2) * sizeof(digit));
 
 	/* Zero out remaining digits. */
-	i = 2*shift - Py_Size(t2);	/* number of uninitialized digits */
+	i = 2*shift - Py_SIZE(t2);	/* number of uninitialized digits */
 	if (i)
-		memset(ret->ob_digit + Py_Size(t2), 0, i * sizeof(digit));
+		memset(ret->ob_digit + Py_SIZE(t2), 0, i * sizeof(digit));
 
 	/* 4 & 5. Subtract ah*bh (t1) and al*bl (t2).  We do al*bl first
 	 * because it's fresher in cache.
 	 */
-	i = Py_Size(ret) - shift;  /* # digits after shift */
-	(void)v_isub(ret->ob_digit + shift, i, t2->ob_digit, Py_Size(t2));
+	i = Py_SIZE(ret) - shift;  /* # digits after shift */
+	(void)v_isub(ret->ob_digit + shift, i, t2->ob_digit, Py_SIZE(t2));
 	Py_DECREF(t2);
 
-	(void)v_isub(ret->ob_digit + shift, i, t1->ob_digit, Py_Size(t1));
+	(void)v_isub(ret->ob_digit + shift, i, t1->ob_digit, Py_SIZE(t1));
 	Py_DECREF(t1);
 
 	/* 6. t3 <- (ah+al)(bh+bl), and add into result. */
@@ -2648,12 +2648,12 @@
 	Py_DECREF(t1);
 	Py_DECREF(t2);
 	if (t3 == NULL) goto fail;
-	assert(Py_Size(t3) >= 0);
+	assert(Py_SIZE(t3) >= 0);
 
 	/* Add t3.  It's not obvious why we can't run out of room here.
 	 * See the (*) comment after this function.
 	 */
-	(void)v_iadd(ret->ob_digit + shift, i, t3->ob_digit, Py_Size(t3));
+	(void)v_iadd(ret->ob_digit + shift, i, t3->ob_digit, Py_SIZE(t3));
 	Py_DECREF(t3);
 
 	return long_normalize(ret);
@@ -2723,8 +2723,8 @@
 static PyLongObject *
 k_lopsided_mul(PyLongObject *a, PyLongObject *b)
 {
-	const Py_ssize_t asize = ABS(Py_Size(a));
-	Py_ssize_t bsize = ABS(Py_Size(b));
+	const Py_ssize_t asize = ABS(Py_SIZE(a));
+	Py_ssize_t bsize = ABS(Py_SIZE(b));
 	Py_ssize_t nbdone;	/* # of b digits already multiplied */
 	PyLongObject *ret;
 	PyLongObject *bslice = NULL;
@@ -2736,7 +2736,7 @@
 	ret = _PyLong_New(asize + bsize);
 	if (ret == NULL)
 		return NULL;
-	memset(ret->ob_digit, 0, Py_Size(ret) * sizeof(digit));
+	memset(ret->ob_digit, 0, Py_SIZE(ret) * sizeof(digit));
 
 	/* Successive slices of b are copied into bslice. */
 	bslice = _PyLong_New(asize);
@@ -2751,14 +2751,14 @@
 		/* Multiply the next slice of b by a. */
 		memcpy(bslice->ob_digit, b->ob_digit + nbdone,
 		       nbtouse * sizeof(digit));
-		Py_Size(bslice) = nbtouse;
+		Py_SIZE(bslice) = nbtouse;
 		product = k_mul(a, bslice);
 		if (product == NULL)
 			goto fail;
 
 		/* Add into result. */
-		(void)v_iadd(ret->ob_digit + nbdone, Py_Size(ret) - nbdone,
-			     product->ob_digit, Py_Size(product));
+		(void)v_iadd(ret->ob_digit + nbdone, Py_SIZE(ret) - nbdone,
+			     product->ob_digit, Py_SIZE(product));
 		Py_DECREF(product);
 
 		bsize -= nbtouse;
@@ -2781,7 +2781,7 @@
 
 	CHECK_BINOP(a, b);
 
-	if (ABS(Py_Size(a)) <= 1 && ABS(Py_Size(b)) <= 1) {
+	if (ABS(Py_SIZE(a)) <= 1 && ABS(Py_SIZE(b)) <= 1) {
 		PyObject *r;
 		r = PyLong_FromLong(MEDIUM_VALUE(a)*MEDIUM_VALUE(b));
 		return r;
@@ -2789,7 +2789,7 @@
 
 	z = k_mul(a, b);
 	/* Negate if exactly one of the inputs is negative. */
-	if (((Py_Size(a) ^ Py_Size(b)) < 0) && z)
+	if (((Py_SIZE(a) ^ Py_SIZE(b)) < 0) && z)
 		NEGATE(z);
 	return (PyObject *)z;
 }
@@ -2823,8 +2823,8 @@
 
 	if (long_divrem(v, w, &div, &mod) < 0)
 		return -1;
-	if ((Py_Size(mod) < 0 && Py_Size(w) > 0) ||
-	    (Py_Size(mod) > 0 && Py_Size(w) < 0)) {
+	if ((Py_SIZE(mod) < 0 && Py_SIZE(w) > 0) ||
+	    (Py_SIZE(mod) > 0 && Py_SIZE(w) < 0)) {
 		PyLongObject *temp;
 		PyLongObject *one;
 		temp = (PyLongObject *) long_add(mod, w);
@@ -2982,7 +2982,7 @@
 		return Py_NotImplemented;
 	}
 
-	if (Py_Size(b) < 0) {  /* if exponent is negative */
+	if (Py_SIZE(b) < 0) {  /* if exponent is negative */
 		if (c) {
 			PyErr_SetString(PyExc_TypeError, "pow() 2nd argument "
 			    "cannot be negative when 3rd argument specified");
@@ -3001,7 +3001,7 @@
 	if (c) {
 		/* if modulus == 0:
 		       raise ValueError() */
-		if (Py_Size(c) == 0) {
+		if (Py_SIZE(c) == 0) {
 			PyErr_SetString(PyExc_ValueError,
 					"pow() 3rd argument cannot be 0");
 			goto Error;
@@ -3010,7 +3010,7 @@
 		/* if modulus < 0:
 		       negativeOutput = True
 		       modulus = -modulus */
-		if (Py_Size(c) < 0) {
+		if (Py_SIZE(c) < 0) {
 			negativeOutput = 1;
 			temp = (PyLongObject *)_PyLong_Copy(c);
 			if (temp == NULL)
@@ -3023,7 +3023,7 @@
 
 		/* if modulus == 1:
 		       return 0 */
-		if ((Py_Size(c) == 1) && (c->ob_digit[0] == 1)) {
+		if ((Py_SIZE(c) == 1) && (c->ob_digit[0] == 1)) {
 			z = (PyLongObject *)PyLong_FromLong(0L);
 			goto Done;
 		}
@@ -3031,7 +3031,7 @@
 		/* if base < 0:
 		       base = base % modulus
 		   Having the base positive just makes things easier. */
-		if (Py_Size(a) < 0) {
+		if (Py_SIZE(a) < 0) {
 			if (l_divmod(a, c, NULL, &temp) < 0)
 				goto Error;
 			Py_DECREF(a);
@@ -3072,10 +3072,10 @@
 	REDUCE(result)					\
 }
 
-	if (Py_Size(b) <= FIVEARY_CUTOFF) {
+	if (Py_SIZE(b) <= FIVEARY_CUTOFF) {
 		/* Left-to-right binary exponentiation (HAC Algorithm 14.79) */
 		/* http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf    */
-		for (i = Py_Size(b) - 1; i >= 0; --i) {
+		for (i = Py_SIZE(b) - 1; i >= 0; --i) {
 			digit bi = b->ob_digit[i];
 
 			for (j = 1 << (PyLong_SHIFT-1); j != 0; j >>= 1) {
@@ -3092,7 +3092,7 @@
 		for (i = 1; i < 32; ++i)
 			MULT(table[i-1], a, table[i])
 
-		for (i = Py_Size(b) - 1; i >= 0; --i) {
+		for (i = Py_SIZE(b) - 1; i >= 0; --i) {
 			const digit bi = b->ob_digit[i];
 
 			for (j = PyLong_SHIFT - 5; j >= 0; j -= 5) {
@@ -3105,7 +3105,7 @@
 		}
 	}
 
-	if (negativeOutput && (Py_Size(z) != 0)) {
+	if (negativeOutput && (Py_SIZE(z) != 0)) {
 		temp = (PyLongObject *)long_sub(z, c);
 		if (temp == NULL)
 			goto Error;
@@ -3122,7 +3122,7 @@
  	}
 	/* fall through */
  Done:
-	if (Py_Size(b) > FIVEARY_CUTOFF) {
+	if (Py_SIZE(b) > FIVEARY_CUTOFF) {
 		for (i = 0; i < 32; ++i)
 			Py_XDECREF(table[i]);
 	}
@@ -3139,7 +3139,7 @@
 	/* Implement ~x as -(x+1) */
 	PyLongObject *x;
 	PyLongObject *w;
-	if (ABS(Py_Size(v)) <=1)
+	if (ABS(Py_SIZE(v)) <=1)
 		return PyLong_FromLong(-(MEDIUM_VALUE(v)+1));
 	w = (PyLongObject *)PyLong_FromLong(1L);
 	if (w == NULL)
@@ -3148,7 +3148,7 @@
 	Py_DECREF(w);
 	if (x == NULL)
 		return NULL;
-	Py_Size(x) = -(Py_Size(x));
+	Py_SIZE(x) = -(Py_SIZE(x));
 	return (PyObject *)x;
 }
 
@@ -3156,18 +3156,18 @@
 long_neg(PyLongObject *v)
 {
 	PyLongObject *z;
-	if (ABS(Py_Size(v)) <= 1)
+	if (ABS(Py_SIZE(v)) <= 1)
 		return PyLong_FromLong(-MEDIUM_VALUE(v));
 	z = (PyLongObject *)_PyLong_Copy(v);
 	if (z != NULL)
-		Py_Size(z) = -(Py_Size(v));
+		Py_SIZE(z) = -(Py_SIZE(v));
 	return (PyObject *)z;
 }
 
 static PyObject *
 long_abs(PyLongObject *v)
 {
-	if (Py_Size(v) < 0)
+	if (Py_SIZE(v) < 0)
 		return long_neg(v);
 	else
 		return long_long((PyObject *)v);
@@ -3176,7 +3176,7 @@
 static int
 long_bool(PyLongObject *v)
 {
-	return ABS(Py_Size(v)) != 0;
+	return ABS(Py_SIZE(v)) != 0;
 }
 
 static PyObject *
@@ -3189,7 +3189,7 @@
 
 	CHECK_BINOP(a, b);
 
-	if (Py_Size(a) < 0) {
+	if (Py_SIZE(a) < 0) {
 		/* Right shifting negative numbers is harder */
 		PyLongObject *a1, *a2;
 		a1 = (PyLongObject *) long_invert(a);
@@ -3213,7 +3213,7 @@
 			goto rshift_error;
 		}
 		wordshift = shiftby / PyLong_SHIFT;
-		newsize = ABS(Py_Size(a)) - wordshift;
+		newsize = ABS(Py_SIZE(a)) - wordshift;
 		if (newsize <= 0) {
 			z = _PyLong_New(0);
 			return (PyObject *)z;
@@ -3225,8 +3225,8 @@
 		z = _PyLong_New(newsize);
 		if (z == NULL)
 			goto rshift_error;
-		if (Py_Size(a) < 0)
-			Py_Size(z) = -(Py_Size(z));
+		if (Py_SIZE(a) < 0)
+			Py_SIZE(z) = -(Py_SIZE(z));
 		for (i = 0, j = wordshift; i < newsize; i++, j++) {
 			z->ob_digit[i] = (a->ob_digit[j] >> loshift) & lomask;
 			if (i+1 < newsize)
@@ -3269,14 +3269,14 @@
 	wordshift = (int)shiftby / PyLong_SHIFT;
 	remshift  = (int)shiftby - wordshift * PyLong_SHIFT;
 
-	oldsize = ABS(Py_Size(a));
+	oldsize = ABS(Py_SIZE(a));
 	newsize = oldsize + wordshift;
 	if (remshift)
 		++newsize;
 	z = _PyLong_New(newsize);
 	if (z == NULL)
 		goto lshift_error;
-	if (Py_Size(a) < 0)
+	if (Py_SIZE(a) < 0)
 		NEGATE(z);
 	for (i = 0; i < wordshift; i++)
 		z->ob_digit[i] = 0;
@@ -3311,7 +3311,7 @@
 	digit diga, digb;
 	PyObject *v;
 
-	if (Py_Size(a) < 0) {
+	if (Py_SIZE(a) < 0) {
 		a = (PyLongObject *) long_invert(a);
 		if (a == NULL)
 			return NULL;
@@ -3321,7 +3321,7 @@
 		Py_INCREF(a);
 		maska = 0;
 	}
-	if (Py_Size(b) < 0) {
+	if (Py_SIZE(b) < 0) {
 		b = (PyLongObject *) long_invert(b);
 		if (b == NULL) {
 			Py_DECREF(a);
@@ -3370,8 +3370,8 @@
 	   whose length should be ignored.
 	*/
 
-	size_a = Py_Size(a);
-	size_b = Py_Size(b);
+	size_a = Py_SIZE(a);
+	size_b = Py_SIZE(b);
 	size_z = op == '&'
 		? (maska
 		   ? size_b
@@ -3478,7 +3478,7 @@
 		/* Since PyLong_FromString doesn't have a length parameter,
 		 * check here for possible NULs in the string. */
 		char *string;
-		int size = Py_Size(x);
+		int size = Py_SIZE(x);
 		if (PyBytes_Check(x))
 			string = PyBytes_AS_STRING(x);
 		else
@@ -3516,7 +3516,7 @@
 	if (tmp == NULL)
 		return NULL;
 	assert(PyLong_CheckExact(tmp));
-	n = Py_Size(tmp);
+	n = Py_SIZE(tmp);
 	if (n < 0)
 		n = -n;
 	newobj = (PyLongObject *)type->tp_alloc(type, n);
@@ -3525,7 +3525,7 @@
 		return NULL;
 	}
 	assert(PyLong_Check(newobj));
-	Py_Size(newobj) = Py_Size(tmp);
+	Py_SIZE(newobj) = Py_SIZE(tmp);
 	for (i = 0; i < n; i++)
 		newobj->ob_digit[i] = tmp->ob_digit[i];
 	Py_DECREF(tmp);
@@ -3719,12 +3719,12 @@
 	PyLongObject *v = small_ints;
 	for (ival = -NSMALLNEGINTS; ival < 0; ival++, v++) {
 		PyObject_INIT(v, &PyLong_Type);
-		Py_Size(v) = -1;
+		Py_SIZE(v) = -1;
 		v->ob_digit[0] = -ival;
 	}
 	for (; ival < NSMALLPOSINTS; ival++, v++) {
 		PyObject_INIT(v, &PyLong_Type);
-		Py_Size(v) = ival ? 1 : 0;
+		Py_SIZE(v) = ival ? 1 : 0;
 		v->ob_digit[0] = ival;
 	}
 #endif

Modified: python/branches/py3k/Objects/moduleobject.c
==============================================================================
--- python/branches/py3k/Objects/moduleobject.c	(original)
+++ python/branches/py3k/Objects/moduleobject.c	Wed Dec 19 03:45:37 2007
@@ -178,7 +178,7 @@
 		_PyModule_Clear((PyObject *)m);
 		Py_DECREF(m->md_dict);
 	}
-	Py_Type(m)->tp_free((PyObject *)m);
+	Py_TYPE(m)->tp_free((PyObject *)m);
 }
 
 static PyObject *

Modified: python/branches/py3k/Objects/object.c
==============================================================================
--- python/branches/py3k/Objects/object.c	(original)
+++ python/branches/py3k/Objects/object.c	Wed Dec 19 03:45:37 2007
@@ -214,7 +214,7 @@
 	if (op == NULL)
 		return PyErr_NoMemory();
 	/* Any changes should be reflected in PyObject_INIT (objimpl.h) */
-	Py_Type(op) = tp;
+	Py_TYPE(op) = tp;
 	_Py_NewReference(op);
 	return op;
 }
@@ -226,7 +226,7 @@
 		return (PyVarObject *) PyErr_NoMemory();
 	/* Any changes should be reflected in PyObject_INIT_VAR */
 	op->ob_size = size;
-	Py_Type(op) = tp;
+	Py_TYPE(op) = tp;
 	_Py_NewReference((PyObject *)op);
 	return op;
 }
@@ -352,7 +352,7 @@
 			"type    : %s\n"
 			"refcount: %ld\n"
 			"address : %p\n",
-			Py_Type(op)==NULL ? "NULL" : Py_Type(op)->tp_name,
+			Py_TYPE(op)==NULL ? "NULL" : Py_TYPE(op)->tp_name,
 			(long)op->ob_refcnt,
 			op);
 	}
@@ -372,7 +372,7 @@
 #endif
 	if (v == NULL)
 		return PyUnicode_FromString("<NULL>");
-	if (Py_Type(v)->tp_repr == NULL)
+	if (Py_TYPE(v)->tp_repr == NULL)
 		return PyUnicode_FromFormat("<%s object at %p>",
                                             v->ob_type->tp_name, v);
         res = (*v->ob_type->tp_repr)(v);
@@ -404,21 +404,21 @@
 		Py_INCREF(v);
 		return v;
 	}
-	if (Py_Type(v)->tp_str == NULL)
+	if (Py_TYPE(v)->tp_str == NULL)
 		return PyObject_Repr(v);
 
 	/* It is possible for a type to have a tp_str representation that loops
 	   infinitely. */
 	if (Py_EnterRecursiveCall(" while getting the str of an object"))
 		return NULL;
-	res = (*Py_Type(v)->tp_str)(v);
+	res = (*Py_TYPE(v)->tp_str)(v);
 	Py_LeaveRecursiveCall();
 	if (res == NULL)
 		return NULL;
 	if (!PyUnicode_Check(res)) {
 		PyErr_Format(PyExc_TypeError,
 			     "__str__ returned non-string (type %.200s)",
-			     Py_Type(res)->tp_name);
+			     Py_TYPE(res)->tp_name);
 		Py_DECREF(res);
 		return NULL;
 	}
@@ -772,8 +772,8 @@
 {
 	PyObject *w, *res;
 
-	if (Py_Type(v)->tp_getattr != NULL)
-		return (*Py_Type(v)->tp_getattr)(v, (char*)name);
+	if (Py_TYPE(v)->tp_getattr != NULL)
+		return (*Py_TYPE(v)->tp_getattr)(v, (char*)name);
 	w = PyUnicode_InternFromString(name);
 	if (w == NULL)
 		return NULL;
@@ -800,8 +800,8 @@
 	PyObject *s;
 	int res;
 
-	if (Py_Type(v)->tp_setattr != NULL)
-		return (*Py_Type(v)->tp_setattr)(v, (char*)name, w);
+	if (Py_TYPE(v)->tp_setattr != NULL)
+		return (*Py_TYPE(v)->tp_setattr)(v, (char*)name, w);
 	s = PyUnicode_InternFromString(name);
 	if (s == NULL)
 		return -1;
@@ -813,7 +813,7 @@
 PyObject *
 PyObject_GetAttr(PyObject *v, PyObject *name)
 {
-	PyTypeObject *tp = Py_Type(v);
+	PyTypeObject *tp = Py_TYPE(v);
 
  	if (!PyUnicode_Check(name)) {
 		PyErr_Format(PyExc_TypeError,
@@ -846,7 +846,7 @@
 int
 PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
 {
-	PyTypeObject *tp = Py_Type(v);
+	PyTypeObject *tp = Py_TYPE(v);
 	int err;
 
 	if (!PyUnicode_Check(name)) {
@@ -893,7 +893,7 @@
 _PyObject_GetDictPtr(PyObject *obj)
 {
 	Py_ssize_t dictoffset;
-	PyTypeObject *tp = Py_Type(obj);
+	PyTypeObject *tp = Py_TYPE(obj);
 
 	dictoffset = tp->tp_dictoffset;
 	if (dictoffset == 0)
@@ -926,7 +926,7 @@
 PyObject *
 PyObject_GenericGetAttr(PyObject *obj, PyObject *name)
 {
-	PyTypeObject *tp = Py_Type(obj);
+	PyTypeObject *tp = Py_TYPE(obj);
 	PyObject *descr = NULL;
 	PyObject *res = NULL;
 	descrgetfunc f;
@@ -1010,7 +1010,7 @@
 	}
 
 	if (f != NULL) {
-		res = f(descr, obj, (PyObject *)Py_Type(obj));
+		res = f(descr, obj, (PyObject *)Py_TYPE(obj));
 		Py_DECREF(descr);
 		goto done;
 	}
@@ -1032,7 +1032,7 @@
 int
 PyObject_GenericSetAttr(PyObject *obj, PyObject *name, PyObject *value)
 {
-	PyTypeObject *tp = Py_Type(obj);
+	PyTypeObject *tp = Py_TYPE(obj);
 	PyObject *descr;
 	descrsetfunc f;
 	PyObject **dictptr;
@@ -1232,7 +1232,7 @@
 	if (!PyList_Check(names)) {
 		PyErr_Format(PyExc_TypeError,
 			"dir(): expected keys() of locals to be a list, "
-			"not '%.200s'", Py_Type(names)->tp_name);
+			"not '%.200s'", Py_TYPE(names)->tp_name);
 		Py_DECREF(names);
 		return NULL;
 	}
@@ -1360,7 +1360,7 @@
 		if (!PyList_Check(result)) {
 			PyErr_Format(PyExc_TypeError,
 				     "__dir__() must return a list, not %.200s",
-				     Py_Type(result)->tp_name);
+				     Py_TYPE(result)->tp_name);
 			Py_DECREF(result);
 			result = NULL;
 		}
@@ -1558,7 +1558,7 @@
 void
 _Py_Dealloc(PyObject *op)
 {
-	destructor dealloc = Py_Type(op)->tp_dealloc;
+	destructor dealloc = Py_TYPE(op)->tp_dealloc;
 	_Py_ForgetReference(op);
 	(*dealloc)(op);
 }
@@ -1589,7 +1589,7 @@
 	fprintf(fp, "Remaining object addresses:\n");
 	for (op = refchain._ob_next; op != &refchain; op = op->_ob_next)
 		fprintf(fp, "%p [%" PY_FORMAT_SIZE_T "d] %s\n", op,
-			op->ob_refcnt, Py_Type(op)->tp_name);
+			op->ob_refcnt, Py_TYPE(op)->tp_name);
 }
 
 PyObject *
@@ -1607,7 +1607,7 @@
 		return NULL;
 	for (i = 0; (n == 0 || i < n) && op != &refchain; i++) {
 		while (op == self || op == args || op == res || op == t ||
-		       (t != NULL && Py_Type(op) != (PyTypeObject *) t)) {
+		       (t != NULL && Py_TYPE(op) != (PyTypeObject *) t)) {
 			op = op->_ob_next;
 			if (op == &refchain)
 				return res;
@@ -1750,7 +1750,7 @@
 {
 	while (_PyTrash_delete_later) {
 		PyObject *op = _PyTrash_delete_later;
-		destructor dealloc = Py_Type(op)->tp_dealloc;
+		destructor dealloc = Py_TYPE(op)->tp_dealloc;
 
 		_PyTrash_delete_later =
 			(PyObject*) _Py_AS_GC(op)->gc.gc_prev;

Modified: python/branches/py3k/Objects/setobject.c
==============================================================================
--- python/branches/py3k/Objects/setobject.c	(original)
+++ python/branches/py3k/Objects/setobject.c	Wed Dec 19 03:45:37 2007
@@ -564,7 +564,7 @@
 	if (num_free_sets < MAXFREESETS && PyAnySet_CheckExact(so))
 		free_sets[num_free_sets++] = so;
 	else 
-		Py_Type(so)->tp_free(so);
+		Py_TYPE(so)->tp_free(so);
 	Py_TRASHCAN_SAFE_END(so)
 }
 
@@ -580,13 +580,13 @@
 	if (status != 0) {
 		if (status < 0)
 			return NULL;
-		return PyUnicode_FromFormat("%s(...)", Py_Type(so)->tp_name);
+		return PyUnicode_FromFormat("%s(...)", Py_TYPE(so)->tp_name);
 	}
 
 	/* shortcut for the empty set */
 	if (!so->used) {
 		Py_ReprLeave((PyObject*)so);
-		return PyUnicode_FromFormat("%s()", Py_Type(so)->tp_name);
+		return PyUnicode_FromFormat("%s()", Py_TYPE(so)->tp_name);
 	}
 
 	keys = PySequence_List((PyObject *)so);
@@ -611,9 +611,9 @@
 		*u++ = '}';
 	}
 	Py_DECREF(listrepr);
-	if (Py_Type(so) != &PySet_Type) {
+	if (Py_TYPE(so) != &PySet_Type) {
 		PyObject *tmp = PyUnicode_FromFormat("%s(%U)",
-						     Py_Type(so)->tp_name,
+						     Py_TYPE(so)->tp_name,
 						     result);
 		Py_DECREF(result);
 		result = tmp;
@@ -979,7 +979,7 @@
 	    (type == &PySet_Type  ||  type == &PyFrozenSet_Type)) {
 		so = free_sets[--num_free_sets];
 		assert (so != NULL && PyAnySet_CheckExact(so));
-		Py_Type(so) = type;
+		Py_TYPE(so) = type;
 		_Py_NewReference((PyObject *)so);
 		EMPTY_TO_MINSIZE(so);
 		PyObject_GC_Track(so);
@@ -1105,8 +1105,8 @@
 		memcpy(b->smalltable, tab, sizeof(tab));
 	}
 
-	if (PyType_IsSubtype(Py_Type(a), &PyFrozenSet_Type)  &&
-	    PyType_IsSubtype(Py_Type(b), &PyFrozenSet_Type)) {
+	if (PyType_IsSubtype(Py_TYPE(a), &PyFrozenSet_Type)  &&
+	    PyType_IsSubtype(Py_TYPE(b), &PyFrozenSet_Type)) {
 		h = a->hash;     a->hash = b->hash;  b->hash = h;
 	} else {
 		a->hash = -1;
@@ -1117,7 +1117,7 @@
 static PyObject *
 set_copy(PySetObject *so)
 {
-	return make_new_set(Py_Type(so), (PyObject *)so);
+	return make_new_set(Py_TYPE(so), (PyObject *)so);
 }
 
 static PyObject *
@@ -1195,7 +1195,7 @@
 	if ((PyObject *)so == other)
 		return set_copy(so);
 
-	result = (PySetObject *)make_new_set(Py_Type(so), NULL);
+	result = (PySetObject *)make_new_set(Py_TYPE(so), NULL);
 	if (result == NULL)
 		return NULL;
 
@@ -1449,7 +1449,7 @@
 		return NULL;
 	}
 	
-	result = make_new_set(Py_Type(so), NULL);
+	result = make_new_set(Py_TYPE(so), NULL);
 	if (result == NULL)
 		return NULL;
 
@@ -1550,7 +1550,7 @@
 		Py_INCREF(other);
 		otherset = (PySetObject *)other;
 	} else {
-		otherset = (PySetObject *)make_new_set(Py_Type(so), other);
+		otherset = (PySetObject *)make_new_set(Py_TYPE(so), other);
 		if (otherset == NULL)
 			return NULL;
 	}
@@ -1581,7 +1581,7 @@
 	PyObject *rv;
 	PySetObject *otherset;
 
-	otherset = (PySetObject *)make_new_set(Py_Type(so), other);
+	otherset = (PySetObject *)make_new_set(Py_TYPE(so), other);
 	if (otherset == NULL)
 		return NULL;
 	rv = set_symmetric_difference_update(otherset, (PyObject *)so);
@@ -1844,7 +1844,7 @@
 		dict = Py_None;
 		Py_INCREF(dict);
 	}
-	result = PyTuple_Pack(3, Py_Type(so), args, dict);
+	result = PyTuple_Pack(3, Py_TYPE(so), args, dict);
 done:
 	Py_XDECREF(args);
 	Py_XDECREF(keys);
@@ -1861,7 +1861,7 @@
 
 	if (!PyAnySet_Check(self))
 		return -1;
-	if (!PyArg_UnpackTuple(args, Py_Type(self)->tp_name, 0, 1, &iterable))
+	if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
 		return -1;
 	set_clear_internal(self);
 	self->hash = -1;
@@ -2153,7 +2153,7 @@
 int
 PySet_Clear(PyObject *set)
 {
-	if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+	if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
 		PyErr_BadInternalCall();
 		return -1;
 	}
@@ -2173,7 +2173,7 @@
 int
 PySet_Discard(PyObject *set, PyObject *key)
 {
-	if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+	if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
 		PyErr_BadInternalCall();
 		return -1;
 	}
@@ -2183,7 +2183,7 @@
 int
 PySet_Add(PyObject *set, PyObject *key)
 {
-	if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+	if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
 		PyErr_BadInternalCall();
 		return -1;
 	}
@@ -2224,7 +2224,7 @@
 PyObject *
 PySet_Pop(PyObject *set)
 {
-	if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+	if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
 		PyErr_BadInternalCall();
 		return NULL;
 	}
@@ -2234,7 +2234,7 @@
 int
 _PySet_Update(PyObject *set, PyObject *iterable)
 {
-	if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+	if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
 		PyErr_BadInternalCall();
 		return -1;
 	}

Modified: python/branches/py3k/Objects/sliceobject.c
==============================================================================
--- python/branches/py3k/Objects/sliceobject.c	(original)
+++ python/branches/py3k/Objects/sliceobject.c	Wed Dec 19 03:45:37 2007
@@ -266,7 +266,7 @@
 static PyObject *
 slice_reduce(PySliceObject* self)
 {
-	return Py_BuildValue("O(OOO)", Py_Type(self), self->start, self->stop, self->step);
+	return Py_BuildValue("O(OOO)", Py_TYPE(self), self->start, self->stop, self->step);
 }
 
 PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");

Modified: python/branches/py3k/Objects/stringlib/string_format.h
==============================================================================
--- python/branches/py3k/Objects/stringlib/string_format.h	(original)
+++ python/branches/py3k/Objects/stringlib/string_format.h	Wed Dec 19 03:45:37 2007
@@ -492,8 +492,8 @@
     }
 
     /* Make sure the type is initialized.  float gets initialized late */
-    if (Py_Type(fieldobj)->tp_dict == NULL)
-        if (PyType_Ready(Py_Type(fieldobj)) < 0)
+    if (Py_TYPE(fieldobj)->tp_dict == NULL)
+        if (PyType_Ready(Py_TYPE(fieldobj)) < 0)
             return NULL;
 
     /* we need to create an object out of the pointers we have */
@@ -502,11 +502,11 @@
         goto done;
 
     /* Find the (unbound!) __format__ method (a borrowed reference) */
-    meth = _PyType_Lookup(Py_Type(fieldobj), format_str);
+    meth = _PyType_Lookup(Py_TYPE(fieldobj), format_str);
     if (meth == NULL) {
         PyErr_Format(PyExc_TypeError,
                      "Type %.100s doesn't define __format__",
-                     Py_Type(fieldobj)->tp_name);
+                     Py_TYPE(fieldobj)->tp_name);
         goto done;
     }
 

Modified: python/branches/py3k/Objects/stringobject.c
==============================================================================
--- python/branches/py3k/Objects/stringobject.c	(original)
+++ python/branches/py3k/Objects/stringobject.c	Wed Dec 19 03:45:37 2007
@@ -12,13 +12,13 @@
 static Py_ssize_t
 _getbuffer(PyObject *obj, Py_buffer *view)
 {
-    PyBufferProcs *buffer = Py_Type(obj)->tp_as_buffer;
+    PyBufferProcs *buffer = Py_TYPE(obj)->tp_as_buffer;
 
     if (buffer == NULL || buffer->bf_getbuffer == NULL)
     {
         PyErr_Format(PyExc_TypeError,
                      "Type %.100s doesn't support the buffer API",
-                     Py_Type(obj)->tp_name);
+                     Py_TYPE(obj)->tp_name);
         return -1;
     }
 
@@ -351,7 +351,7 @@
 static void
 string_dealloc(PyObject *op)
 {
-	Py_Type(op)->tp_free(op);
+	Py_TYPE(op)->tp_free(op);
 }
 
 /* Unescape a backslash-escaped string. If unicode is non-zero,
@@ -509,7 +509,7 @@
 {
 	if (!PyString_Check(op))
 		return string_getsize(op);
-	return Py_Size(op);
+	return Py_SIZE(op);
 }
 
 /*const*/ char *
@@ -517,7 +517,7 @@
 {
 	if (!PyString_Check(op)) {
 		PyErr_Format(PyExc_TypeError,
-		     "expected bytes, %.200s found", Py_Type(op)->tp_name);
+		     "expected bytes, %.200s found", Py_TYPE(op)->tp_name);
 		return NULL;
 	}
 	return ((PyStringObject *)op) -> ob_sval;
@@ -535,7 +535,7 @@
 
 	if (!PyString_Check(obj)) {
 		PyErr_Format(PyExc_TypeError,
-		     "expected bytes, %.200s found", Py_Type(obj)->tp_name);
+		     "expected bytes, %.200s found", Py_TYPE(obj)->tp_name);
 		return -1;
 	}
 
@@ -579,7 +579,7 @@
 {
 	static const char *hexdigits = "0123456789abcdef";
 	register PyStringObject* op = (PyStringObject*) obj;
-	Py_ssize_t length = Py_Size(op);
+	Py_ssize_t length = Py_SIZE(op);
 	size_t newsize = 3 + 4 * length;
 	PyObject *v;
 	if (newsize > PY_SSIZE_T_MAX || (newsize-3) / 4 != length) {
@@ -668,7 +668,7 @@
 static Py_ssize_t
 string_length(PyStringObject *a)
 {
-	return Py_Size(a);
+	return Py_SIZE(a);
 }
 
 /* This is also used by PyString_Concat() */
@@ -684,7 +684,7 @@
 	if (_getbuffer(a, &va) < 0  ||
 	    _getbuffer(b, &vb) < 0) {
 		PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
-			     Py_Type(a)->tp_name, Py_Type(b)->tp_name);
+			     Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
 		goto done;
 	}
 
@@ -733,13 +733,13 @@
 	/* watch out for overflows:  the size can overflow int,
 	 * and the # of bytes needed can overflow size_t
 	 */
-	size = Py_Size(a) * n;
-	if (n && size / n != Py_Size(a)) {
+	size = Py_SIZE(a) * n;
+	if (n && size / n != Py_SIZE(a)) {
 		PyErr_SetString(PyExc_OverflowError,
 			"repeated string is too long");
 		return NULL;
 	}
-	if (size == Py_Size(a) && PyString_CheckExact(a)) {
+	if (size == Py_SIZE(a) && PyString_CheckExact(a)) {
 		Py_INCREF(a);
 		return (PyObject *)a;
 	}
@@ -756,14 +756,14 @@
 	PyObject_INIT_VAR(op, &PyString_Type, size);
 	op->ob_shash = -1;
 	op->ob_sval[size] = '\0';
-	if (Py_Size(a) == 1 && n > 0) {
+	if (Py_SIZE(a) == 1 && n > 0) {
 		memset(op->ob_sval, a->ob_sval[0] , n);
 		return (PyObject *) op;
 	}
 	i = 0;
 	if (i < size) {
-		Py_MEMCPY(op->ob_sval, a->ob_sval, Py_Size(a));
-		i = Py_Size(a);
+		Py_MEMCPY(op->ob_sval, a->ob_sval, Py_SIZE(a));
+		i = Py_SIZE(a);
 	}
 	while (i < size) {
 		j = (i <= size-i)  ?  i  :  size-i;
@@ -783,7 +783,7 @@
         PyErr_Clear();
         if (_getbuffer(arg, &varg) < 0)
             return -1;
-        pos = stringlib_find(PyString_AS_STRING(self), Py_Size(self),
+        pos = stringlib_find(PyString_AS_STRING(self), Py_SIZE(self),
                              varg.buf, varg.len, 0);
         PyObject_ReleaseBuffer(arg, &varg);
         return pos >= 0;
@@ -793,13 +793,13 @@
         return -1;
     }
 
-    return memchr(PyString_AS_STRING(self), ival, Py_Size(self)) != NULL;
+    return memchr(PyString_AS_STRING(self), ival, Py_SIZE(self)) != NULL;
 }
 
 static PyObject *
 string_item(PyStringObject *a, register Py_ssize_t i)
 {
-	if (i < 0 || i >= Py_Size(a)) {
+	if (i < 0 || i >= Py_SIZE(a)) {
 		PyErr_SetString(PyExc_IndexError, "string index out of range");
 		return NULL;
 	}
@@ -841,16 +841,16 @@
 	if (op == Py_EQ) {
 		/* Supporting Py_NE here as well does not save
 		   much time, since Py_NE is rarely used.  */
-		if (Py_Size(a) == Py_Size(b)
+		if (Py_SIZE(a) == Py_SIZE(b)
 		    && (a->ob_sval[0] == b->ob_sval[0]
-			&& memcmp(a->ob_sval, b->ob_sval, Py_Size(a)) == 0)) {
+			&& memcmp(a->ob_sval, b->ob_sval, Py_SIZE(a)) == 0)) {
 			result = Py_True;
 		} else {
 			result = Py_False;
 		}
 		goto out;
 	}
-	len_a = Py_Size(a); len_b = Py_Size(b);
+	len_a = Py_SIZE(a); len_b = Py_SIZE(b);
 	min_len = (len_a < len_b) ? len_a : len_b;
 	if (min_len > 0) {
 		c = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);
@@ -886,12 +886,12 @@
 
 	if (a->ob_shash != -1)
 		return a->ob_shash;
-	len = Py_Size(a);
+	len = Py_SIZE(a);
 	p = (unsigned char *) a->ob_sval;
 	x = *p << 7;
 	while (--len >= 0)
 		x = (1000003*x) ^ *p++;
-	x ^= Py_Size(a);
+	x ^= Py_SIZE(a);
 	if (x == -1)
 		x = -2;
 	a->ob_shash = x;
@@ -960,7 +960,7 @@
 	else {
 		PyErr_Format(PyExc_TypeError,
 			     "string indices must be integers, not %.200s",
-			     Py_Type(item)->tp_name);
+			     Py_TYPE(item)->tp_name);
 		return NULL;
 	}
 }
@@ -968,7 +968,7 @@
 static int
 string_buffer_getbuffer(PyStringObject *self, Py_buffer *view, int flags)
 {
-	return PyBuffer_FillInfo(view, (void *)self->ob_sval, Py_Size(self),
+	return PyBuffer_FillInfo(view, (void *)self->ob_sval, Py_SIZE(self),
 				 0, flags);
 }
 
@@ -1043,7 +1043,7 @@
 	count++; }
 
 /* Always force the list to the expected size. */
-#define FIX_PREALLOC_SIZE(list) Py_Size(list) = count
+#define FIX_PREALLOC_SIZE(list) Py_SIZE(list) = count
 
 #define SKIP_SPACE(s, i, len)    { while (i<len &&  ISSPACE(s[i])) i++; }
 #define SKIP_NONSPACE(s, i, len) { while (i<len && !ISSPACE(s[i])) i++; }
@@ -1474,11 +1474,11 @@
 			PyErr_Format(PyExc_TypeError,
 				     "sequence item %zd: expected bytes,"
 				     " %.80s found",
-				     i, Py_Type(item)->tp_name);
+				     i, Py_TYPE(item)->tp_name);
 			Py_DECREF(seq);
 			return NULL;
 		}
-		sz += Py_Size(item);
+		sz += Py_SIZE(item);
 		if (i != 0)
 			sz += seplen;
 		if (sz < old_sz || sz > PY_SSIZE_T_MAX) {
@@ -1508,7 +1508,7 @@
 			p += seplen;
 		}
 		item = PySequence_Fast_GET_ITEM(seq, i);
-		n = Py_Size(item);
+		n = Py_SIZE(item);
                 if (PyString_Check(item))
 			q = PyString_AS_STRING(item);
 		else
@@ -2792,7 +2792,7 @@
 static PyObject *
 string_getnewargs(PyStringObject *v)
 {
-	return Py_BuildValue("(s#)", v->ob_sval, Py_Size(v));
+	return Py_BuildValue("(s#)", v->ob_sval, Py_SIZE(v));
 }
 
 
@@ -3132,7 +3132,7 @@
 	register PyObject *v;
 	register PyStringObject *sv;
 	v = *pv;
-	if (!PyString_Check(v) || Py_Refcnt(v) != 1 || newsize < 0) {
+	if (!PyString_Check(v) || Py_REFCNT(v) != 1 || newsize < 0) {
 		*pv = 0;
 		Py_DECREF(v);
 		PyErr_BadInternalCall();
@@ -3150,7 +3150,7 @@
 	}
 	_Py_NewReference(*pv);
 	sv = (PyStringObject *) *pv;
-	Py_Size(sv) = newsize;
+	Py_SIZE(sv) = newsize;
 	sv->ob_sval[newsize] = '\0';
 	sv->ob_shash = -1;	/* invalidate cached hash value */
 	return 0;
@@ -3204,7 +3204,7 @@
 		if (PyBool_Check(val))
 			result = PyNumber_ToBase(val, 10);
 		else
-			result = Py_Type(val)->tp_str(val);
+			result = Py_TYPE(val)->tp_str(val);
 		break;
 	case 'o':
 		numnondigits = 2;
@@ -3228,7 +3228,7 @@
 	}
 
 	/* To modify the string in-place, there can only be one reference. */
-	if (Py_Refcnt(result) != 1) {
+	if (Py_REFCNT(result) != 1) {
 		PyErr_BadInternalCall();
 		return NULL;
 	}

Modified: python/branches/py3k/Objects/structseq.c
==============================================================================
--- python/branches/py3k/Objects/structseq.c	(original)
+++ python/branches/py3k/Objects/structseq.c	Wed Dec 19 03:45:37 2007
@@ -13,17 +13,17 @@
    They are only allowed for indices < n_visible_fields. */
 char *PyStructSequence_UnnamedField = "unnamed field";
 
-#define VISIBLE_SIZE(op) Py_Size(op)
+#define VISIBLE_SIZE(op) Py_SIZE(op)
 #define VISIBLE_SIZE_TP(tp) PyLong_AsLong( \
                       PyDict_GetItemString((tp)->tp_dict, visible_length_key))
 
 #define REAL_SIZE_TP(tp) PyLong_AsLong( \
                       PyDict_GetItemString((tp)->tp_dict, real_length_key))
-#define REAL_SIZE(op) REAL_SIZE_TP(Py_Type(op))
+#define REAL_SIZE(op) REAL_SIZE_TP(Py_TYPE(op))
 
 #define UNNAMED_FIELDS_TP(tp) PyLong_AsLong( \
                       PyDict_GetItemString((tp)->tp_dict, unnamed_fields_key))
-#define UNNAMED_FIELDS(op) UNNAMED_FIELDS_TP(Py_Type(op))
+#define UNNAMED_FIELDS(op) UNNAMED_FIELDS_TP(Py_TYPE(op))
 
 
 PyObject *
@@ -32,7 +32,7 @@
 	PyStructSequence *obj;
        
 	obj = PyObject_New(PyStructSequence, type);
-	Py_Size(obj) = VISIBLE_SIZE_TP(type);
+	Py_SIZE(obj) = VISIBLE_SIZE_TP(type);
 
 	return (PyObject*) obj;
 }
@@ -322,12 +322,12 @@
 	}
 	
 	for (; i < n_fields; i++) {
-		char *n = Py_Type(self)->tp_members[i-n_unnamed_fields].name;
+		char *n = Py_TYPE(self)->tp_members[i-n_unnamed_fields].name;
 		PyDict_SetItemString(dict, n,
 				     self->ob_item[i]);
 	}
 
-	result = Py_BuildValue("(O(OO))", Py_Type(self), tup, dict);
+	result = Py_BuildValue("(O(OO))", Py_TYPE(self), tup, dict);
 
 	Py_DECREF(tup);
 	Py_DECREF(dict);

Modified: python/branches/py3k/Objects/tupleobject.c
==============================================================================
--- python/branches/py3k/Objects/tupleobject.c	(original)
+++ python/branches/py3k/Objects/tupleobject.c	Wed Dec 19 03:45:37 2007
@@ -49,8 +49,8 @@
 #endif
 		/* Inline PyObject_InitVar */
 #ifdef Py_TRACE_REFS
-		Py_Size(op) = size;
-		Py_Type(op) = &PyTuple_Type;
+		Py_SIZE(op) = size;
+		Py_TYPE(op) = &PyTuple_Type;
 #endif
 		_Py_NewReference((PyObject *)op);
 	}
@@ -90,7 +90,7 @@
 		return -1;
 	}
 	else
-		return Py_Size(op);
+		return Py_SIZE(op);
 }
 
 PyObject *
@@ -100,7 +100,7 @@
 		PyErr_BadInternalCall();
 		return NULL;
 	}
-	if (i < 0 || i >= Py_Size(op)) {
+	if (i < 0 || i >= Py_SIZE(op)) {
 		PyErr_SetString(PyExc_IndexError, "tuple index out of range");
 		return NULL;
 	}
@@ -117,7 +117,7 @@
 		PyErr_BadInternalCall();
 		return -1;
 	}
-	if (i < 0 || i >= Py_Size(op)) {
+	if (i < 0 || i >= Py_SIZE(op)) {
 		Py_XDECREF(newitem);
 		PyErr_SetString(PyExc_IndexError,
 				"tuple assignment index out of range");
@@ -160,7 +160,7 @@
 tupledealloc(register PyTupleObject *op)
 {
 	register Py_ssize_t i;
-	register Py_ssize_t len =  Py_Size(op);
+	register Py_ssize_t len =  Py_SIZE(op);
 	PyObject_GC_UnTrack(op);
 	Py_TRASHCAN_SAFE_BEGIN(op)
 	if (len > 0) {
@@ -170,7 +170,7 @@
 #if MAXSAVESIZE > 0
 		if (len < MAXSAVESIZE &&
 		    num_free_tuples[len] < MAXSAVEDTUPLES &&
-		    Py_Type(op) == &PyTuple_Type)
+		    Py_TYPE(op) == &PyTuple_Type)
 		{
 			op->ob_item[0] = (PyObject *) free_tuples[len];
 			num_free_tuples[len]++;
@@ -179,7 +179,7 @@
 		}
 #endif
 	}
-	Py_Type(op)->tp_free((PyObject *)op);
+	Py_TYPE(op)->tp_free((PyObject *)op);
 done:
 	Py_TRASHCAN_SAFE_END(op)
 }
@@ -191,7 +191,7 @@
 	PyObject *s, *temp;
 	PyObject *pieces, *result = NULL;
 
-	n = Py_Size(v);
+	n = Py_SIZE(v);
 	if (n == 0)
 		return PyUnicode_FromString("()");
 
@@ -264,7 +264,7 @@
 tuplehash(PyTupleObject *v)
 {
 	register long x, y;
-	register Py_ssize_t len = Py_Size(v);
+	register Py_ssize_t len = Py_SIZE(v);
 	register PyObject **p;
 	long mult = 1000003L;
 	x = 0x345678L;
@@ -286,7 +286,7 @@
 static Py_ssize_t
 tuplelength(PyTupleObject *a)
 {
-	return Py_Size(a);
+	return Py_SIZE(a);
 }
 
 static int
@@ -295,7 +295,7 @@
 	Py_ssize_t i;
 	int cmp;
 
-	for (i = 0, cmp = 0 ; cmp == 0 && i < Py_Size(a); ++i)
+	for (i = 0, cmp = 0 ; cmp == 0 && i < Py_SIZE(a); ++i)
 		cmp = PyObject_RichCompareBool(el, PyTuple_GET_ITEM(a, i),
 						   Py_EQ);
 	return cmp;
@@ -304,7 +304,7 @@
 static PyObject *
 tupleitem(register PyTupleObject *a, register Py_ssize_t i)
 {
-	if (i < 0 || i >= Py_Size(a)) {
+	if (i < 0 || i >= Py_SIZE(a)) {
 		PyErr_SetString(PyExc_IndexError, "tuple index out of range");
 		return NULL;
 	}
@@ -322,11 +322,11 @@
 	Py_ssize_t len;
 	if (ilow < 0)
 		ilow = 0;
-	if (ihigh > Py_Size(a))
-		ihigh = Py_Size(a);
+	if (ihigh > Py_SIZE(a))
+		ihigh = Py_SIZE(a);
 	if (ihigh < ilow)
 		ihigh = ilow;
-	if (ilow == 0 && ihigh == Py_Size(a) && PyTuple_CheckExact(a)) {
+	if (ilow == 0 && ihigh == Py_SIZE(a) && PyTuple_CheckExact(a)) {
 		Py_INCREF(a);
 		return (PyObject *)a;
 	}
@@ -364,11 +364,11 @@
 	if (!PyTuple_Check(bb)) {
 		PyErr_Format(PyExc_TypeError,
        		     "can only concatenate tuple (not \"%.200s\") to tuple",
-			     Py_Type(bb)->tp_name);
+			     Py_TYPE(bb)->tp_name);
 		return NULL;
 	}
 #define b ((PyTupleObject *)bb)
-	size = Py_Size(a) + Py_Size(b);
+	size = Py_SIZE(a) + Py_SIZE(b);
 	if (size < 0)
 		return PyErr_NoMemory();
 	np = (PyTupleObject *) PyTuple_New(size);
@@ -377,14 +377,14 @@
 	}
 	src = a->ob_item;
 	dest = np->ob_item;
-	for (i = 0; i < Py_Size(a); i++) {
+	for (i = 0; i < Py_SIZE(a); i++) {
 		PyObject *v = src[i];
 		Py_INCREF(v);
 		dest[i] = v;
 	}
 	src = b->ob_item;
-	dest = np->ob_item + Py_Size(a);
-	for (i = 0; i < Py_Size(b); i++) {
+	dest = np->ob_item + Py_SIZE(a);
+	for (i = 0; i < Py_SIZE(b); i++) {
 		PyObject *v = src[i];
 		Py_INCREF(v);
 		dest[i] = v;
@@ -402,18 +402,18 @@
 	PyObject **p, **items;
 	if (n < 0)
 		n = 0;
-	if (Py_Size(a) == 0 || n == 1) {
+	if (Py_SIZE(a) == 0 || n == 1) {
 		if (PyTuple_CheckExact(a)) {
 			/* Since tuples are immutable, we can return a shared
 			   copy in this case */
 			Py_INCREF(a);
 			return (PyObject *)a;
 		}
-		if (Py_Size(a) == 0)
+		if (Py_SIZE(a) == 0)
 			return PyTuple_New(0);
 	}
-	size = Py_Size(a) * n;
-	if (size/Py_Size(a) != n)
+	size = Py_SIZE(a) * n;
+	if (size/Py_SIZE(a) != n)
 		return PyErr_NoMemory();
 	np = (PyTupleObject *) PyTuple_New(size);
 	if (np == NULL)
@@ -421,7 +421,7 @@
 	p = np->ob_item;
 	items = a->ob_item;
 	for (i = 0; i < n; i++) {
-		for (j = 0; j < Py_Size(a); j++) {
+		for (j = 0; j < Py_SIZE(a); j++) {
 			*p = items[j];
 			Py_INCREF(*p);
 			p++;
@@ -435,7 +435,7 @@
 {
 	Py_ssize_t i;
 
-	for (i = Py_Size(o); --i >= 0; )
+	for (i = Py_SIZE(o); --i >= 0; )
 		Py_VISIT(o->ob_item[i]);
 	return 0;
 }
@@ -455,8 +455,8 @@
 	vt = (PyTupleObject *)v;
 	wt = (PyTupleObject *)w;
 
-	vlen = Py_Size(vt);
-	wlen = Py_Size(wt);
+	vlen = Py_SIZE(vt);
+	wlen = Py_SIZE(wt);
 
 	/* Note:  the corresponding code for lists has an "early out" test
 	 * here when op is EQ or NE and the lengths differ.  That pays there,
@@ -624,7 +624,7 @@
 	else {
 		PyErr_Format(PyExc_TypeError, 
 			     "tuple indices must be integers, not %.200s",
-			     Py_Type(item)->tp_name);
+			     Py_TYPE(item)->tp_name);
 		return NULL;
 	}
 }
@@ -632,7 +632,7 @@
 static PyObject *
 tuple_getnewargs(PyTupleObject *v)
 {
-	return Py_BuildValue("(N)", tupleslice(v, 0, Py_Size(v)));
+	return Py_BuildValue("(N)", tupleslice(v, 0, Py_SIZE(v)));
 	
 }
 
@@ -708,14 +708,14 @@
 	Py_ssize_t oldsize;
 
 	v = (PyTupleObject *) *pv;
-	if (v == NULL || Py_Type(v) != &PyTuple_Type ||
-	    (Py_Size(v) != 0 && Py_Refcnt(v) != 1)) {
+	if (v == NULL || Py_TYPE(v) != &PyTuple_Type ||
+	    (Py_SIZE(v) != 0 && Py_REFCNT(v) != 1)) {
 		*pv = 0;
 		Py_XDECREF(v);
 		PyErr_BadInternalCall();
 		return -1;
 	}
-	oldsize = Py_Size(v);
+	oldsize = Py_SIZE(v);
 	if (oldsize == newsize)
 		return 0;
 

Modified: python/branches/py3k/Objects/typeobject.c
==============================================================================
--- python/branches/py3k/Objects/typeobject.c	(original)
+++ python/branches/py3k/Objects/typeobject.c	Wed Dec 19 03:45:37 2007
@@ -60,7 +60,7 @@
 	if (!PyUnicode_Check(value)) {
 		PyErr_Format(PyExc_TypeError,
 			     "can only assign string to %s.__name__, not '%s'",
-			     type->tp_name, Py_Type(value)->tp_name);
+			     type->tp_name, Py_TYPE(value)->tp_name);
 		return -1;
 	}
 
@@ -216,7 +216,7 @@
 	if (!PyTuple_Check(value)) {
 		PyErr_Format(PyExc_TypeError,
 		     "can only assign tuple to %s.__bases__, not %s",
-			     type->tp_name, Py_Type(value)->tp_name);
+			     type->tp_name, Py_TYPE(value)->tp_name);
 		return -1;
 	}
 	if (PyTuple_GET_SIZE(value) == 0) {
@@ -231,7 +231,7 @@
 			PyErr_Format(
 				PyExc_TypeError,
 	"%s.__bases__ must be tuple of old- or new-style classes, not '%s'",
-				type->tp_name, Py_Type(ob)->tp_name);
+				type->tp_name, Py_TYPE(ob)->tp_name);
 			return -1;
 		}
 		if (PyType_Check(ob)) {
@@ -356,8 +356,8 @@
 		result = Py_None;
 		Py_INCREF(result);
 	}
-	else if (Py_Type(result)->tp_descr_get) {
-		result = Py_Type(result)->tp_descr_get(result, NULL,
+	else if (Py_TYPE(result)->tp_descr_get) {
+		result = Py_TYPE(result)->tp_descr_get(result, NULL,
 						       (PyObject *)type);
 	}
 	else {
@@ -430,9 +430,9 @@
 			return obj;
 		/* If the returned object is not an instance of type,
 		   it won't be initialized. */
-		if (!PyType_IsSubtype(Py_Type(obj), type))
+		if (!PyType_IsSubtype(Py_TYPE(obj), type))
 			return obj;
-		type = Py_Type(obj);
+		type = Py_TYPE(obj);
 		if (type->tp_init != NULL &&
 		    type->tp_init(obj, args, kwds) < 0) {
 			Py_DECREF(obj);
@@ -486,7 +486,7 @@
 	Py_ssize_t i, n;
 	PyMemberDef *mp;
 
-	n = Py_Size(type);
+	n = Py_SIZE(type);
 	mp = PyHeapType_GET_MEMBERS((PyHeapTypeObject *)type);
 	for (i = 0; i < n; i++, mp++) {
 		if (mp->type == T_OBJECT_EX) {
@@ -510,10 +510,10 @@
 
 	/* Find the nearest base with a different tp_traverse,
 	   and traverse slots while we're at it */
-	type = Py_Type(self);
+	type = Py_TYPE(self);
 	base = type;
 	while ((basetraverse = base->tp_traverse) == subtype_traverse) {
-		if (Py_Size(base)) {
+		if (Py_SIZE(base)) {
 			int err = traverse_slots(base, self, visit, arg);
 			if (err)
 				return err;
@@ -545,7 +545,7 @@
 	Py_ssize_t i, n;
 	PyMemberDef *mp;
 
-	n = Py_Size(type);
+	n = Py_SIZE(type);
 	mp = PyHeapType_GET_MEMBERS((PyHeapTypeObject *)type);
 	for (i = 0; i < n; i++, mp++) {
 		if (mp->type == T_OBJECT_EX && !(mp->flags & READONLY)) {
@@ -567,10 +567,10 @@
 
 	/* Find the nearest base with a different tp_clear
 	   and clear slots while we're at it */
-	type = Py_Type(self);
+	type = Py_TYPE(self);
 	base = type;
 	while ((baseclear = base->tp_clear) == subtype_clear) {
-		if (Py_Size(base))
+		if (Py_SIZE(base))
 			clear_slots(base, self);
 		base = base->tp_base;
 		assert(base);
@@ -591,7 +591,7 @@
 	destructor basedealloc;
 
 	/* Extract the type; we expect it to be a heap type */
-	type = Py_Type(self);
+	type = Py_TYPE(self);
 	assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);
 
 	/* Test whether the type has GC exactly once */
@@ -613,7 +613,7 @@
 		/* Find the nearest base with a different tp_dealloc */
 		base = type;
 		while ((basedealloc = base->tp_dealloc) == subtype_dealloc) {
-			assert(Py_Size(base) == 0);
+			assert(Py_SIZE(base) == 0);
 			base = base->tp_base;
 			assert(base);
 		}
@@ -681,7 +681,7 @@
 	/*  Clear slots up to the nearest base with a different tp_dealloc */
 	base = type;
 	while ((basedealloc = base->tp_dealloc) == subtype_dealloc) {
-		if (Py_Size(base))
+		if (Py_SIZE(base))
 			clear_slots(base, self);
 		base = base->tp_base;
 		assert(base);
@@ -872,13 +872,13 @@
 		if (*attrobj == NULL)
 			return NULL;
 	}
-	res = _PyType_Lookup(Py_Type(self), *attrobj);
+	res = _PyType_Lookup(Py_TYPE(self), *attrobj);
 	if (res != NULL) {
 		descrgetfunc f;
-		if ((f = Py_Type(res)->tp_descr_get) == NULL)
+		if ((f = Py_TYPE(res)->tp_descr_get) == NULL)
 			Py_INCREF(res);
 		else
-			res = f(res, self, (PyObject *)(Py_Type(self)));
+			res = f(res, self, (PyObject *)(Py_TYPE(self)));
 	}
 	return res;
 }
@@ -1251,7 +1251,7 @@
 	PyObject *mro, *result, *tuple;
 	int checkit = 0;
 
-	if (Py_Type(type) == &PyType_Type) {
+	if (Py_TYPE(type) == &PyType_Type) {
 		result = mro_implementation(type);
 	}
 	else {
@@ -1284,7 +1284,7 @@
 			if (!PyType_Check(cls)) {
 				PyErr_Format(PyExc_TypeError,
 			     "mro() returned a non-class ('%.500s')",
-					     Py_Type(cls)->tp_name);
+					     Py_TYPE(cls)->tp_name);
 				Py_DECREF(tuple);
 				return -1;
 			}
@@ -1440,7 +1440,7 @@
 {
 	PyErr_Format(PyExc_TypeError,
 		     "this __dict__ descriptor does not support "
-		     "'%.200s' objects", Py_Type(obj)->tp_name);
+		     "'%.200s' objects", Py_TYPE(obj)->tp_name);
 }
 
 static PyObject *
@@ -1450,7 +1450,7 @@
 	PyObject *dict;
 	PyTypeObject *base;
 
-	base = get_builtin_base_with_dict(Py_Type(obj));
+	base = get_builtin_base_with_dict(Py_TYPE(obj));
 	if (base != NULL) {
 		descrgetfunc func;
 		PyObject *descr = get_dict_descriptor(base);
@@ -1458,12 +1458,12 @@
 			raise_dict_descr_error(obj);
 			return NULL;
 		}
-		func = Py_Type(descr)->tp_descr_get;
+		func = Py_TYPE(descr)->tp_descr_get;
 		if (func == NULL) {
 			raise_dict_descr_error(obj);
 			return NULL;
 		}
-		return func(descr, obj, (PyObject *)(Py_Type(obj)));
+		return func(descr, obj, (PyObject *)(Py_TYPE(obj)));
 	}
 
 	dictptr = _PyObject_GetDictPtr(obj);
@@ -1486,7 +1486,7 @@
 	PyObject *dict;
 	PyTypeObject *base;
 
-	base = get_builtin_base_with_dict(Py_Type(obj));
+	base = get_builtin_base_with_dict(Py_TYPE(obj));
 	if (base != NULL) {
 		descrsetfunc func;
 		PyObject *descr = get_dict_descriptor(base);
@@ -1494,7 +1494,7 @@
 			raise_dict_descr_error(obj);
 			return -1;
 		}
-		func = Py_Type(descr)->tp_descr_set;
+		func = Py_TYPE(descr)->tp_descr_set;
 		if (func == NULL) {
 			raise_dict_descr_error(obj);
 			return -1;
@@ -1511,7 +1511,7 @@
 	if (value != NULL && !PyDict_Check(value)) {
 		PyErr_Format(PyExc_TypeError,
 			     "__dict__ must be set to a dictionary, "
-			     "not a '%.200s'", Py_Type(value)->tp_name);
+			     "not a '%.200s'", Py_TYPE(value)->tp_name);
 		return -1;
 	}
 	dict = *dictptr;
@@ -1527,16 +1527,16 @@
 	PyObject **weaklistptr;
 	PyObject *result;
 
-	if (Py_Type(obj)->tp_weaklistoffset == 0) {
+	if (Py_TYPE(obj)->tp_weaklistoffset == 0) {
 		PyErr_SetString(PyExc_AttributeError,
 				"This object has no __weakref__");
 		return NULL;
 	}
-	assert(Py_Type(obj)->tp_weaklistoffset > 0);
-	assert(Py_Type(obj)->tp_weaklistoffset + sizeof(PyObject *) <=
-	       (size_t)(Py_Type(obj)->tp_basicsize));
+	assert(Py_TYPE(obj)->tp_weaklistoffset > 0);
+	assert(Py_TYPE(obj)->tp_weaklistoffset + sizeof(PyObject *) <=
+	       (size_t)(Py_TYPE(obj)->tp_basicsize));
 	weaklistptr = (PyObject **)
-		((char *)obj + Py_Type(obj)->tp_weaklistoffset);
+		((char *)obj + Py_TYPE(obj)->tp_weaklistoffset);
 	if (*weaklistptr == NULL)
 		result = Py_None;
 	else
@@ -1573,7 +1573,7 @@
 	if (!PyUnicode_Check(s)) {
 		PyErr_Format(PyExc_TypeError,
 			     "__slots__ items must be strings, not '%.200s'",
-			     Py_Type(s)->tp_name);
+			     Py_TYPE(s)->tp_name);
 		return 0;
 	}
 	if (!PyUnicode_IsIdentifier(s)) {
@@ -1639,8 +1639,8 @@
 
 		if (PyType_CheckExact(metatype) && nargs == 1 && nkwds == 0) {
 			PyObject *x = PyTuple_GET_ITEM(args, 0);
-			Py_INCREF(Py_Type(x));
-			return (PyObject *) Py_Type(x);
+			Py_INCREF(Py_TYPE(x));
+			return (PyObject *) Py_TYPE(x);
 		}
 
 		/* SF bug 475327 -- if that didn't trigger, we need 3
@@ -1668,7 +1668,7 @@
 	winner = metatype;
 	for (i = 0; i < nbases; i++) {
 		tmp = PyTuple_GET_ITEM(bases, i);
-		tmptype = Py_Type(tmp);
+		tmptype = Py_TYPE(tmp);
 		if (PyType_IsSubtype(winner, tmptype))
 			continue;
 		if (PyType_IsSubtype(tmptype, winner)) {
@@ -2055,7 +2055,7 @@
 static PyObject *
 type_getattro(PyTypeObject *type, PyObject *name)
 {
-	PyTypeObject *metatype = Py_Type(type);
+	PyTypeObject *metatype = Py_TYPE(type);
 	PyObject *meta_attribute, *attribute;
 	descrgetfunc meta_get;
 
@@ -2072,7 +2072,7 @@
 	meta_attribute = _PyType_Lookup(metatype, name);
 
 	if (meta_attribute != NULL) {
-		meta_get = Py_Type(meta_attribute)->tp_descr_get;
+		meta_get = Py_TYPE(meta_attribute)->tp_descr_get;
 
 		if (meta_get != NULL && PyDescr_IsData(meta_attribute)) {
 			/* Data descriptors implement tp_descr_set to intercept
@@ -2090,7 +2090,7 @@
 	attribute = _PyType_Lookup(type, name);
 	if (attribute != NULL) {
 		/* Implement descriptor functionality, if any */
-		descrgetfunc local_get = Py_Type(attribute)->tp_descr_get;
+		descrgetfunc local_get = Py_TYPE(attribute)->tp_descr_get;
 
 		Py_XDECREF(meta_attribute);
 
@@ -2168,7 +2168,7 @@
 	PyObject_Free((char *)type->tp_doc);
 	Py_XDECREF(et->ht_name);
 	Py_XDECREF(et->ht_slots);
-	Py_Type(type)->tp_free((PyObject *)type);
+	Py_TYPE(type)->tp_free((PyObject *)type);
 }
 
 static PyObject *
@@ -2388,7 +2388,7 @@
 {
 	int err = 0;
 	if (excess_args(args, kwds)) {
-		PyTypeObject *type = Py_Type(self);
+		PyTypeObject *type = Py_TYPE(self);
 		if (type->tp_init != object_init &&
 		    type->tp_new != object_new)
 		{
@@ -2435,7 +2435,7 @@
 static void
 object_dealloc(PyObject *self)
 {
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static PyObject *
@@ -2444,7 +2444,7 @@
 	PyTypeObject *type;
 	PyObject *mod, *name, *rtn;
 
-	type = Py_Type(self);
+	type = Py_TYPE(self);
 	mod = type_module(type, NULL);
 	if (mod == NULL)
 		PyErr_Clear();
@@ -2470,7 +2470,7 @@
 {
 	unaryfunc f;
 
-	f = Py_Type(self)->tp_repr;
+	f = Py_TYPE(self)->tp_repr;
 	if (f == NULL)
 		f = object_repr;
 	return f(self);
@@ -2519,8 +2519,8 @@
 static PyObject *
 object_get_class(PyObject *self, void *closure)
 {
-	Py_INCREF(Py_Type(self));
-	return (PyObject *)(Py_Type(self));
+	Py_INCREF(Py_TYPE(self));
+	return (PyObject *)(Py_TYPE(self));
 }
 
 static int
@@ -2605,7 +2605,7 @@
 static int
 object_set_class(PyObject *self, PyObject *value, void *closure)
 {
-	PyTypeObject *oldto = Py_Type(self);
+	PyTypeObject *oldto = Py_TYPE(self);
 	PyTypeObject *newto;
 
 	if (value == NULL) {
@@ -2616,7 +2616,7 @@
 	if (!PyType_Check(value)) {
 		PyErr_Format(PyExc_TypeError,
 		  "__class__ must be set to new-style class, not '%s' object",
-		  Py_Type(value)->tp_name);
+		  Py_TYPE(value)->tp_name);
 		return -1;
 	}
 	newto = (PyTypeObject *)value;
@@ -2629,7 +2629,7 @@
 	}
 	if (compatible_for_assignment(newto, oldto, "__class__")) {
 		Py_INCREF(newto);
-		Py_Type(self) = newto;
+		Py_TYPE(self) = newto;
 		Py_DECREF(oldto);
 		return 0;
 	}
@@ -2725,7 +2725,7 @@
 		if (args != NULL && !PyTuple_Check(args)) {
 			PyErr_Format(PyExc_TypeError,
 				"__getnewargs__ should return a tuple, "
-				"not '%.200s'", Py_Type(args)->tp_name);
+				"not '%.200s'", Py_TYPE(args)->tp_name);
 			goto end;
 		}
 	}
@@ -3403,8 +3403,8 @@
 	   NULL when type is &PyBaseObject_Type, and we know its ob_type is
 	   not NULL (it's initialized to &PyType_Type).	 But coverity doesn't
 	   know that. */
-	if (Py_Type(type) == NULL && base != NULL)
-		Py_Type(type) = Py_Type(base);
+	if (Py_TYPE(type) == NULL && base != NULL)
+		Py_TYPE(type) = Py_TYPE(base);
 
 	/* Initialize tp_bases */
 	bases = type->tp_bases;
@@ -3673,7 +3673,7 @@
 	if (!check_num_args(args, 1))
 		return NULL;
 	other = PyTuple_GET_ITEM(args, 0);
-	if (!PyType_IsSubtype(Py_Type(other), Py_Type(self))) {
+	if (!PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self))) {
 		Py_INCREF(Py_NotImplemented);
 		return Py_NotImplemented;
 	}
@@ -3742,7 +3742,7 @@
 	if (i == -1 && PyErr_Occurred())
 		return -1;
 	if (i < 0) {
-		PySequenceMethods *sq = Py_Type(self)->tp_as_sequence;
+		PySequenceMethods *sq = Py_TYPE(self)->tp_as_sequence;
 		if (sq && sq->sq_length) {
 			Py_ssize_t n = (*sq->sq_length)(self);
 			if (n < 0)
@@ -3874,14 +3874,14 @@
 	if (!check_num_args(args, 1))
 		return NULL;
 	other = PyTuple_GET_ITEM(args, 0);
-	if (Py_Type(other)->tp_compare != func &&
-	    !PyType_IsSubtype(Py_Type(other), Py_Type(self))) {
+	if (Py_TYPE(other)->tp_compare != func &&
+	    !PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self))) {
 		PyErr_Format(
 			PyExc_TypeError,
 			"%s.__cmp__(x,y) requires y to be a '%s', not a '%s'",
-			Py_Type(self)->tp_name,
-			Py_Type(self)->tp_name,
-			Py_Type(other)->tp_name);
+			Py_TYPE(self)->tp_name,
+			Py_TYPE(self)->tp_name,
+			Py_TYPE(other)->tp_name);
 		return NULL;
 	}
 	res = (*func)(self, other);
@@ -3895,7 +3895,7 @@
 static int
 hackcheck(PyObject *self, setattrofunc func, char *what)
 {
-	PyTypeObject *type = Py_Type(self);
+	PyTypeObject *type = Py_TYPE(self);
 	while (type && type->tp_flags & Py_TPFLAGS_HEAPTYPE)
 		type = type->tp_base;
 	/* If type is NULL now, this is a really weird type.
@@ -4095,7 +4095,7 @@
 		PyErr_Format(PyExc_TypeError,
 			     "%s.__new__(X): X is not a type object (%s)",
 			     type->tp_name,
-			     Py_Type(arg0)->tp_name);
+			     Py_TYPE(arg0)->tp_name);
 		return NULL;
 	}
 	subtype = (PyTypeObject *)arg0;
@@ -4186,14 +4186,14 @@
 	PyObject *a, *b;
 	int ok;
 
-	b = PyObject_GetAttrString((PyObject *)(Py_Type(right)), name);
+	b = PyObject_GetAttrString((PyObject *)(Py_TYPE(right)), name);
 	if (b == NULL) {
 		PyErr_Clear();
 		/* If right doesn't have it, it's not overloaded */
 		return 0;
 	}
 
-	a = PyObject_GetAttrString((PyObject *)(Py_Type(left)), name);
+	a = PyObject_GetAttrString((PyObject *)(Py_TYPE(left)), name);
 	if (a == NULL) {
 		PyErr_Clear();
 		Py_DECREF(b);
@@ -4218,14 +4218,14 @@
 FUNCNAME(PyObject *self, PyObject *other) \
 { \
 	static PyObject *cache_str, *rcache_str; \
-	int do_other = Py_Type(self) != Py_Type(other) && \
-	    Py_Type(other)->tp_as_number != NULL && \
-	    Py_Type(other)->tp_as_number->SLOTNAME == TESTFUNC; \
-	if (Py_Type(self)->tp_as_number != NULL && \
-	    Py_Type(self)->tp_as_number->SLOTNAME == TESTFUNC) { \
+	int do_other = Py_TYPE(self) != Py_TYPE(other) && \
+	    Py_TYPE(other)->tp_as_number != NULL && \
+	    Py_TYPE(other)->tp_as_number->SLOTNAME == TESTFUNC; \
+	if (Py_TYPE(self)->tp_as_number != NULL && \
+	    Py_TYPE(self)->tp_as_number->SLOTNAME == TESTFUNC) { \
 		PyObject *r; \
 		if (do_other && \
-		    PyType_IsSubtype(Py_Type(other), Py_Type(self)) && \
+		    PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self)) && \
 		    method_is_overloaded(self, other, ROPSTR)) { \
 			r = call_maybe( \
 				other, ROPSTR, &rcache_str, "(O)", self); \
@@ -4237,7 +4237,7 @@
 		r = call_maybe( \
 			self, OPSTR, &cache_str, "(O)", other); \
 		if (r != Py_NotImplemented || \
-		    Py_Type(other) == Py_Type(self)) \
+		    Py_TYPE(other) == Py_TYPE(self)) \
 			return r; \
 		Py_DECREF(r); \
 	} \
@@ -4295,12 +4295,12 @@
 		if (getitem_str == NULL)
 			return NULL;
 	}
-	func = _PyType_Lookup(Py_Type(self), getitem_str);
+	func = _PyType_Lookup(Py_TYPE(self), getitem_str);
 	if (func != NULL) {
-		if ((f = Py_Type(func)->tp_descr_get) == NULL)
+		if ((f = Py_TYPE(func)->tp_descr_get) == NULL)
 			Py_INCREF(func);
 		else {
-			func = f(func, self, (PyObject *)(Py_Type(self)));
+			func = f(func, self, (PyObject *)(Py_TYPE(self)));
 			if (func == NULL) {
 				return NULL;
 			}
@@ -4418,8 +4418,8 @@
 	/* Three-arg power doesn't use __rpow__.  But ternary_op
 	   can call this when the second argument's type uses
 	   slot_nb_power, so check before calling self.__pow__. */
-	if (Py_Type(self)->tp_as_number != NULL &&
-	    Py_Type(self)->tp_as_number->nb_power == slot_nb_power) {
+	if (Py_TYPE(self)->tp_as_number != NULL &&
+	    Py_TYPE(self)->tp_as_number->nb_power == slot_nb_power) {
 		return call_method(self, "__pow__", &pow_str,
 				   "(OO)", other, modulus);
 	}
@@ -4464,7 +4464,7 @@
 				PyErr_Format(PyExc_TypeError,
 					 "__bool__ should return "
 					 "bool, returned %s",
-					 Py_Type(temp)->tp_name);
+					 Py_TYPE(temp)->tp_name);
 				result = -1;
 			}
 			Py_DECREF(temp);
@@ -4555,12 +4555,12 @@
 {
 	int c;
 
-	if (Py_Type(self)->tp_compare == _PyObject_SlotCompare) {
+	if (Py_TYPE(self)->tp_compare == _PyObject_SlotCompare) {
 		c = half_compare(self, other);
 		if (c <= 1)
 			return c;
 	}
-	if (Py_Type(other)->tp_compare == _PyObject_SlotCompare) {
+	if (Py_TYPE(other)->tp_compare == _PyObject_SlotCompare) {
 		c = half_compare(other, self);
 		if (c < -1)
 			return -2;
@@ -4585,7 +4585,7 @@
 	}
 	PyErr_Clear();
 	return PyUnicode_FromFormat("<%s object at %p>",
-				   Py_Type(self)->tp_name, self);
+				   Py_TYPE(self)->tp_name, self);
 }
 
 static PyObject *
@@ -4628,7 +4628,7 @@
 
 	if (func == NULL) {
 		PyErr_Format(PyExc_TypeError, "unhashable type: '%.200s'",
-			     Py_Type(self)->tp_name);
+			     Py_TYPE(self)->tp_name);
 		return -1;
         }
 
@@ -4684,7 +4684,7 @@
 static PyObject *
 slot_tp_getattr_hook(PyObject *self, PyObject *name)
 {
-	PyTypeObject *tp = Py_Type(self);
+	PyTypeObject *tp = Py_TYPE(self);
 	PyObject *getattr, *getattribute, *res;
 	static PyObject *getattribute_str = NULL;
 	static PyObject *getattr_str = NULL;
@@ -4708,7 +4708,7 @@
 	}
 	getattribute = _PyType_Lookup(tp, getattribute_str);
 	if (getattribute == NULL ||
-	    (Py_Type(getattribute) == &PyWrapperDescr_Type &&
+	    (Py_TYPE(getattribute) == &PyWrapperDescr_Type &&
 	     ((PyWrapperDescrObject *)getattribute)->d_wrapped ==
 	     (void *)PyObject_GenericGetAttr))
 		res = PyObject_GenericGetAttr(self, name);
@@ -4767,13 +4767,13 @@
 {
 	PyObject *res;
 
-	if (Py_Type(self)->tp_richcompare == slot_tp_richcompare) {
+	if (Py_TYPE(self)->tp_richcompare == slot_tp_richcompare) {
 		res = half_richcompare(self, other, op);
 		if (res != Py_NotImplemented)
 			return res;
 		Py_DECREF(res);
 	}
-	if (Py_Type(other)->tp_richcompare == slot_tp_richcompare) {
+	if (Py_TYPE(other)->tp_richcompare == slot_tp_richcompare) {
 		res = half_richcompare(other, self, _Py_SwappedOp[op]);
 		if (res != Py_NotImplemented) {
 			return res;
@@ -4806,7 +4806,7 @@
 	if (func == NULL) {
 		PyErr_Format(PyExc_TypeError,
 			     "'%.200s' object is not iterable",
-			     Py_Type(self)->tp_name);
+			     Py_TYPE(self)->tp_name);
 		return NULL;
 	}
 	Py_DECREF(func);
@@ -4823,7 +4823,7 @@
 static PyObject *
 slot_tp_descr_get(PyObject *self, PyObject *obj, PyObject *type)
 {
-	PyTypeObject *tp = Py_Type(self);
+	PyTypeObject *tp = Py_TYPE(self);
 	PyObject *get;
 	static PyObject *get_str = NULL;
 
@@ -4881,7 +4881,7 @@
 	if (res != Py_None) {
 		PyErr_Format(PyExc_TypeError,
 			     "__init__() should return None, not '%.200s'",
-			     Py_Type(res)->tp_name);
+			     Py_TYPE(res)->tp_name);
 		Py_DECREF(res);
 		return -1;
 	}
@@ -4966,7 +4966,7 @@
 		_Py_NewReference(self);
 		self->ob_refcnt = refcnt;
 	}
-	assert(!PyType_IS_GC(Py_Type(self)) ||
+	assert(!PyType_IS_GC(Py_TYPE(self)) ||
 	       _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
 	/* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
 	 * we need to undo that. */
@@ -4978,8 +4978,8 @@
 	 * undone.
 	 */
 #ifdef COUNT_ALLOCS
-	--Py_Type(self)->tp_frees;
-	--Py_Type(self)->tp_allocs;
+	--Py_TYPE(self)->tp_frees;
+	--Py_TYPE(self)->tp_allocs;
 #endif
 }
 
@@ -5314,7 +5314,7 @@
 		descr = _PyType_Lookup(type, p->name_strobj);
 		if (descr == NULL)
 			continue;
-		if (Py_Type(descr) == &PyWrapperDescr_Type) {
+		if (Py_TYPE(descr) == &PyWrapperDescr_Type) {
 			void **tptr = resolve_slotdups(type, p->name_strobj);
 			if (tptr == NULL || tptr == ptr)
 				generic = p->function;
@@ -5329,7 +5329,7 @@
 					use_generic = 1;
 			}
 		}
-		else if (Py_Type(descr) == &PyCFunction_Type &&
+		else if (Py_TYPE(descr) == &PyCFunction_Type &&
 			 PyCFunction_GET_FUNCTION(descr) ==
 			 (PyCFunction)tp_new_wrapper &&
 			 strcmp(p->name, "__new__") == 0)
@@ -5600,7 +5600,7 @@
 	Py_XDECREF(su->obj);
 	Py_XDECREF(su->type);
 	Py_XDECREF(su->obj_type);
-	Py_Type(self)->tp_free(self);
+	Py_TYPE(self)->tp_free(self);
 }
 
 static PyObject *
@@ -5663,7 +5663,7 @@
 			res = PyDict_GetItem(dict, name);
 			if (res != NULL) {
 				Py_INCREF(res);
-				f = Py_Type(res)->tp_descr_get;
+				f = Py_TYPE(res)->tp_descr_get;
 				if (f != NULL) {
 					tmp = f(res,
 						/* Only pass 'obj' param if
@@ -5699,7 +5699,7 @@
 	     the normal case; the return value is obj.__class__.
 
 	   But... when obj is an instance, we want to allow for the case where
-	   Py_Type(obj) is not a subclass of type, but obj.__class__ is!
+	   Py_TYPE(obj) is not a subclass of type, but obj.__class__ is!
 	   This will allow using super() with a proxy for obj.
 	*/
 
@@ -5710,9 +5710,9 @@
 	}
 
 	/* Normal case */
-	if (PyType_IsSubtype(Py_Type(obj), type)) {
-		Py_INCREF(Py_Type(obj));
-		return Py_Type(obj);
+	if (PyType_IsSubtype(Py_TYPE(obj), type)) {
+		Py_INCREF(Py_TYPE(obj));
+		return Py_TYPE(obj);
 	}
 	else {
 		/* Try the slow way */
@@ -5729,7 +5729,7 @@
 
 		if (class_attr != NULL &&
 		    PyType_Check(class_attr) &&
-		    (PyTypeObject *)class_attr != Py_Type(obj))
+		    (PyTypeObject *)class_attr != Py_TYPE(obj))
 		{
 			int ok = PyType_IsSubtype(
 				(PyTypeObject *)class_attr, type);
@@ -5760,10 +5760,10 @@
 		Py_INCREF(self);
 		return self;
 	}
-	if (Py_Type(su) != &PySuper_Type)
+	if (Py_TYPE(su) != &PySuper_Type)
 		/* If su is an instance of a (strict) subclass of super,
 		   call its type */
-		return PyObject_CallFunctionObjArgs((PyObject *)Py_Type(su),
+		return PyObject_CallFunctionObjArgs((PyObject *)Py_TYPE(su),
 						    su->type, obj, NULL);
 	else {
 		/* Inline the common case */
@@ -5845,7 +5845,7 @@
 				if (!PyType_Check(type)) {
 				    PyErr_Format(PyExc_SystemError,
 				      "super(): __class__ is not a type (%s)",
-				      Py_Type(type)->tp_name);
+				      Py_TYPE(type)->tp_name);
 				    return -1;
 				}
 				break;

Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c	(original)
+++ python/branches/py3k/Objects/unicodeobject.c	Wed Dec 19 03:45:37 2007
@@ -313,7 +313,7 @@
 
         case SSTATE_INTERNED_MORTAL:
             /* revive dead object temporarily for DelItem */
-            Py_Refcnt(unicode) = 3;
+            Py_REFCNT(unicode) = 3;
             if (PyDict_DelItem(interned, (PyObject *)unicode) != 0)
                 Py_FatalError(
                     "deletion of interned unicode string failed");
@@ -346,7 +346,7 @@
     else {
 	PyMem_DEL(unicode->str);
 	Py_XDECREF(unicode->defenc);
-	Py_Type(unicode)->tp_free((PyObject *)unicode);
+	Py_TYPE(unicode)->tp_free((PyObject *)unicode);
     }
 }
 
@@ -360,7 +360,7 @@
 	return -1;
     }
     v = (PyUnicodeObject *)*unicode;
-    if (v == NULL || !PyUnicode_Check(v) || Py_Refcnt(v) != 1 || length < 0) {
+    if (v == NULL || !PyUnicode_Check(v) || Py_REFCNT(v) != 1 || length < 0) {
 	PyErr_BadInternalCall();
 	return -1;
     }
@@ -1000,7 +1000,7 @@
     }
     PyErr_Format(PyExc_TypeError,
                  "Can't convert '%.100s' object to str implicitly",
-                 Py_Type(obj)->tp_name);
+                 Py_TYPE(obj)->tp_name);
     return NULL;
 }
 
@@ -1035,7 +1035,7 @@
 	PyErr_Format(PyExc_TypeError,
 			 "coercing to Unicode: need string or buffer, "
 			 "%.80s found",
-		     Py_Type(obj)->tp_name);
+		     Py_TYPE(obj)->tp_name);
 	goto onError;
     }
 
@@ -1115,7 +1115,7 @@
     if (!PyUnicode_Check(unicode)) {
         PyErr_Format(PyExc_TypeError,
                      "decoder did not return an unicode object (type=%.400s)",
-                     Py_Type(unicode)->tp_name);
+                     Py_TYPE(unicode)->tp_name);
         Py_DECREF(unicode);
         goto onError;
     }
@@ -2351,7 +2351,7 @@
     }
 
   done:
-    result = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_Size(v));
+    result = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_SIZE(v));
     Py_DECREF(v);
     return result;
 #undef STORECHAR
@@ -2615,7 +2615,7 @@
     }
 
   done:
-    result = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_Size(v));
+    result = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_SIZE(v));
     Py_DECREF(v);
     return result;
 #undef STORECHAR
@@ -4367,7 +4367,7 @@
     char *outstart;
     Py_ssize_t outsize = PyString_GET_SIZE(*outobj);
 
-    if (Py_Type(mapping) == &EncodingMapType) {
+    if (Py_TYPE(mapping) == &EncodingMapType) {
         int res = encoding_map_lookup(c, mapping);
 	Py_ssize_t requiredsize = *outpos+1;
         if (res == -1)
@@ -4439,7 +4439,7 @@
     /* find all unencodable characters */
     while (collendpos < size) {
         PyObject *rep;
-        if (Py_Type(mapping) == &EncodingMapType) {
+        if (Py_TYPE(mapping) == &EncodingMapType) {
 	    int res = encoding_map_lookup(p[collendpos], mapping);
 	    if (res != -1)
 		break;
@@ -5482,7 +5482,7 @@
 	    PyErr_Format(PyExc_TypeError,
 			 "sequence item %zd: expected str instance,"
 			 " %.80s found",
-			 i, Py_Type(item)->tp_name);
+			 i, Py_TYPE(item)->tp_name);
 	    goto onError;
 	}
 	item = PyUnicode_FromObject(item);
@@ -6505,7 +6505,7 @@
         PyErr_Format(PyExc_TypeError,
                      "encoder did not return a bytes object "
                      "(type=%.400s)",
-                     Py_Type(v)->tp_name);
+                     Py_TYPE(v)->tp_name);
         Py_DECREF(v);
         return NULL;
     }
@@ -6647,12 +6647,12 @@
 
     if (self->hash != -1)
         return self->hash;
-    len = Py_Size(self);
+    len = Py_SIZE(self);
     p = self->str;
     x = *p << 7;
     while (--len >= 0)
         x = (1000003*x) ^ *p++;
-    x ^= Py_Size(self);
+    x ^= Py_SIZE(self);
     if (x == -1)
         x = -2;
     self->hash = x;
@@ -8514,7 +8514,7 @@
 	arglen = -1;
 	argidx = -2;
     }
-    if (Py_Type(args)->tp_as_mapping && !PyTuple_Check(args) &&
+    if (Py_TYPE(args)->tp_as_mapping && !PyTuple_Check(args) &&
         !PyUnicode_Check(args))
 	dict = args;
 
@@ -9120,7 +9120,7 @@
 	PyThreadState_GET()->recursion_critical = 0;
 	/* The two references in interned are not counted by refcnt.
 	   The deallocator will take care of this */
-	Py_Refcnt(s) -= 2;
+	Py_REFCNT(s) -= 2;
 	PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL;
 }
 
@@ -9174,11 +9174,11 @@
 			/* XXX Shouldn't happen */
 			break;
 		case SSTATE_INTERNED_IMMORTAL:
-			Py_Refcnt(s) += 1;
+			Py_REFCNT(s) += 1;
 			immortal_size += s->length;
 			break;
 		case SSTATE_INTERNED_MORTAL:
-			Py_Refcnt(s) += 2;
+			Py_REFCNT(s) += 2;
 			mortal_size += s->length;
 			break;
 		default:

Modified: python/branches/py3k/Objects/weakrefobject.c
==============================================================================
--- python/branches/py3k/Objects/weakrefobject.c	(original)
+++ python/branches/py3k/Objects/weakrefobject.c	Wed Dec 19 03:45:37 2007
@@ -105,7 +105,7 @@
 {
     PyObject_GC_UnTrack(self);
     clear_weakref((PyWeakReference *) self);
-    Py_Type(self)->tp_free(self);
+    Py_TYPE(self)->tp_free(self);
 }
 
 
@@ -172,7 +172,7 @@
 		      name ? "<weakref at %p; to '%.50s' at %p (%s)>"
 		           : "<weakref at %p; to '%.50s' at %p>",
 		      self,
-		      Py_Type(PyWeakref_GET_OBJECT(self))->tp_name,
+		      Py_TYPE(PyWeakref_GET_OBJECT(self))->tp_name,
 		      PyWeakref_GET_OBJECT(self),
 		      name);
 	Py_XDECREF(nameobj);
@@ -276,10 +276,10 @@
         PyWeakReference *ref, *proxy;
         PyWeakReference **list;
 
-        if (!PyType_SUPPORTS_WEAKREFS(Py_Type(ob))) {
+        if (!PyType_SUPPORTS_WEAKREFS(Py_TYPE(ob))) {
             PyErr_Format(PyExc_TypeError,
                          "cannot create weak reference to '%s' object",
-                         Py_Type(ob)->tp_name);
+                         Py_TYPE(ob)->tp_name);
             return NULL;
         }
         if (callback == Py_None)
@@ -448,7 +448,7 @@
     char buf[160];
     PyOS_snprintf(buf, sizeof(buf),
 		  "<weakproxy at %p to %.100s at %p>", proxy,
-		  Py_Type(PyWeakref_GET_OBJECT(proxy))->tp_name,
+		  Py_TYPE(PyWeakref_GET_OBJECT(proxy))->tp_name,
 		  PyWeakref_GET_OBJECT(proxy));
     return PyUnicode_FromString(buf);
 }
@@ -699,10 +699,10 @@
     PyWeakReference **list;
     PyWeakReference *ref, *proxy;
 
-    if (!PyType_SUPPORTS_WEAKREFS(Py_Type(ob))) {
+    if (!PyType_SUPPORTS_WEAKREFS(Py_TYPE(ob))) {
         PyErr_Format(PyExc_TypeError,
 		     "cannot create weak reference to '%s' object",
-                     Py_Type(ob)->tp_name);
+                     Py_TYPE(ob)->tp_name);
         return NULL;
     }
     list = GET_WEAKREFS_LISTPTR(ob);
@@ -758,10 +758,10 @@
     PyWeakReference **list;
     PyWeakReference *ref, *proxy;
 
-    if (!PyType_SUPPORTS_WEAKREFS(Py_Type(ob))) {
+    if (!PyType_SUPPORTS_WEAKREFS(Py_TYPE(ob))) {
         PyErr_Format(PyExc_TypeError,
 		     "cannot create weak reference to '%s' object",
-                     Py_Type(ob)->tp_name);
+                     Py_TYPE(ob)->tp_name);
         return NULL;
     }
     list = GET_WEAKREFS_LISTPTR(ob);
@@ -784,9 +784,9 @@
             PyWeakReference *prev;
 
             if (PyCallable_Check(ob))
-                Py_Type(result) = &_PyWeakref_CallableProxyType;
+                Py_TYPE(result) = &_PyWeakref_CallableProxyType;
             else
-                Py_Type(result) = &_PyWeakref_ProxyType;
+                Py_TYPE(result) = &_PyWeakref_ProxyType;
             get_basic_refs(*list, &ref, &proxy);
             if (callback == NULL) {
                 if (proxy != NULL) {
@@ -851,7 +851,7 @@
     PyWeakReference **list;
 
     if (object == NULL
-        || !PyType_SUPPORTS_WEAKREFS(Py_Type(object))
+        || !PyType_SUPPORTS_WEAKREFS(Py_TYPE(object))
         || object->ob_refcnt != 0) {
         PyErr_BadInternalCall();
         return;

Modified: python/branches/py3k/PC/_subprocess.c
==============================================================================
--- python/branches/py3k/PC/_subprocess.c	(original)
+++ python/branches/py3k/PC/_subprocess.c	Wed Dec 19 03:45:37 2007
@@ -269,7 +269,7 @@
 		PyErr_Clear(); /* FIXME: propagate error? */
 		return NULL;
 	}
-	if (Py_Type(value) != &sp_handle_type)
+	if (Py_TYPE(value) != &sp_handle_type)
 		ret = NULL;
 	else
 		ret = value->handle;
@@ -552,7 +552,7 @@
 	PyObject *m;
 
 	/* patch up object descriptors */
-	Py_Type(&sp_handle_type) = &PyType_Type;
+	Py_TYPE(&sp_handle_type) = &PyType_Type;
 	sp_handle_as_number.nb_int = (unaryfunc) sp_handle_as_int;
 
 	m = Py_InitModule("_subprocess", sp_functions);

Modified: python/branches/py3k/PC/_winreg.c
==============================================================================
--- python/branches/py3k/PC/_winreg.c	(original)
+++ python/branches/py3k/PC/_winreg.c	Wed Dec 19 03:45:37 2007
@@ -522,7 +522,7 @@
 		return PyLong_FromVoidPtr(((PyHKEYObject *)self)->hkey);
 	PyErr_Format(PyExc_AttributeError,
                      "'%.50s' object has no attribute '%.400s'",
-                     Py_Type(self)->tp_name, name);
+                     Py_TYPE(self)->tp_name, name);
 	return NULL;
 }
 
@@ -1388,7 +1388,7 @@
 	if (m == NULL)
 		return;
 	d = PyModule_GetDict(m);
-	Py_Type(&PyHKEY_Type) = &PyType_Type;
+	Py_TYPE(&PyHKEY_Type) = &PyType_Type;
 	PyHKEY_Type.tp_doc = PyHKEY_doc;
 	Py_INCREF(&PyHKEY_Type);
 	if (PyDict_SetItemString(d, "HKEYType",

Modified: python/branches/py3k/Parser/tokenizer.c
==============================================================================
--- python/branches/py3k/Parser/tokenizer.c	(original)
+++ python/branches/py3k/Parser/tokenizer.c	Wed Dec 19 03:45:37 2007
@@ -1600,7 +1600,7 @@
 							       tok->buf,
 							       *offset-1);
 				if (offsetobj) {
-					*offset = 1 + Py_Size(offsetobj);
+					*offset = 1 + Py_SIZE(offsetobj);
 					Py_DECREF(offsetobj);
 				}
 			}

Modified: python/branches/py3k/Python/ast.c
==============================================================================
--- python/branches/py3k/Python/ast.c	(original)
+++ python/branches/py3k/Python/ast.c	Wed Dec 19 03:45:37 2007
@@ -3156,7 +3156,7 @@
                     return NULL;
                 }
                 r = PyString_AS_STRING(w);
-                rn = Py_Size(w);
+                rn = Py_SIZE(w);
                 assert(rn % 2 == 0);
                 for (i = 0; i < rn; i += 2) {
                     sprintf(p, "\\u%02x%02x",

Modified: python/branches/py3k/Python/bltinmodule.c
==============================================================================
--- python/branches/py3k/Python/bltinmodule.c	(original)
+++ python/branches/py3k/Python/bltinmodule.c	Wed Dec 19 03:45:37 2007
@@ -309,16 +309,16 @@
     }
 
     /* Make sure the type is initialized.  float gets initialized late */
-    if (Py_Type(value)->tp_dict == NULL)
-        if (PyType_Ready(Py_Type(value)) < 0)
+    if (Py_TYPE(value)->tp_dict == NULL)
+        if (PyType_Ready(Py_TYPE(value)) < 0)
             goto done;
 
     /* Find the (unbound!) __format__ method (a borrowed reference) */
-    meth = _PyType_Lookup(Py_Type(value), format_str);
+    meth = _PyType_Lookup(Py_TYPE(value), format_str);
     if (meth == NULL) {
         PyErr_Format(PyExc_TypeError,
                 "Type %.100s doesn't define __format__",
-                Py_Type(value)->tp_name);
+                Py_TYPE(value)->tp_name);
             goto done;
     }
 
@@ -1433,8 +1433,8 @@
                 kwlist, &number, &ndigits))
                 return NULL;
 
-	if (Py_Type(number)->tp_dict == NULL) {
-		if (PyType_Ready(Py_Type(number)) < 0)
+	if (Py_TYPE(number)->tp_dict == NULL) {
+		if (PyType_Ready(Py_TYPE(number)) < 0)
 			return NULL;
 	}
 
@@ -1444,11 +1444,11 @@
 			return NULL;
 	}
 
-	round = _PyType_Lookup(Py_Type(number), round_str);
+	round = _PyType_Lookup(Py_TYPE(number), round_str);
 	if (round == NULL) {
 		PyErr_Format(PyExc_TypeError,
 			     "type %.100s doesn't define __round__ method",
-			     Py_Type(number)->tp_name);
+			     Py_TYPE(number)->tp_name);
 		return NULL;
 	}
 
@@ -1552,8 +1552,8 @@
 	static PyObject *trunc_str = NULL;
 	PyObject *trunc;
 
-	if (Py_Type(number)->tp_dict == NULL) {
-		if (PyType_Ready(Py_Type(number)) < 0)
+	if (Py_TYPE(number)->tp_dict == NULL) {
+		if (PyType_Ready(Py_TYPE(number)) < 0)
 			return NULL;
 	}
 
@@ -1563,11 +1563,11 @@
 			return NULL;
 	}
 
-	trunc = _PyType_Lookup(Py_Type(number), trunc_str);
+	trunc = _PyType_Lookup(Py_TYPE(number), trunc_str);
 	if (trunc == NULL) {
 		PyErr_Format(PyExc_TypeError,
 			     "type %.100s doesn't define __trunc__ method",
-			     Py_Type(number)->tp_name);
+			     Py_TYPE(number)->tp_name);
 		return NULL;
 	}
 	return PyObject_CallFunction(trunc, "O", number);

Modified: python/branches/py3k/Python/ceval.c
==============================================================================
--- python/branches/py3k/Python/ceval.c	(original)
+++ python/branches/py3k/Python/ceval.c	Wed Dec 19 03:45:37 2007
@@ -3006,7 +3006,7 @@
 		*--sp = PyList_GET_ITEM(l, ll - j);
 	}
 	/* Resize the list. */
-	Py_Size(l) = ll - argcntafter;
+	Py_SIZE(l) = ll - argcntafter;
 	Py_DECREF(it);
 	return 1;
 
@@ -3496,7 +3496,7 @@
 	}
 	if (argdefs != NULL) {
 		d = &PyTuple_GET_ITEM(argdefs, 0);
-		nd = Py_Size(argdefs);
+		nd = Py_SIZE(argdefs);
 	}
 	return PyEval_EvalCodeEx(co, globals,
 				 (PyObject *)NULL, (*pp_stack)-n, na,

Modified: python/branches/py3k/Python/codecs.c
==============================================================================
--- python/branches/py3k/Python/codecs.c	(original)
+++ python/branches/py3k/Python/codecs.c	Wed Dec 19 03:45:37 2007
@@ -354,7 +354,7 @@
             v = NULL;
             goto onError;
         }
-        v = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_Size(v));
+        v = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_SIZE(v));
     }
     else if (PyString_Check(v))
         Py_INCREF(v);

Modified: python/branches/py3k/Python/marshal.c
==============================================================================
--- python/branches/py3k/Python/marshal.c	(original)
+++ python/branches/py3k/Python/marshal.c	Wed Dec 19 03:45:37 2007
@@ -153,7 +153,7 @@
 			PyLongObject *ob = (PyLongObject *)v;
 			PyErr_Clear();
 			w_byte(TYPE_LONG, p);
-			n = Py_Size(ob);
+			n = Py_SIZE(ob);
 			w_long((long)n, p);
 			if (n < 0)
 				n = -n;
@@ -557,7 +557,7 @@
 				retval = NULL;
 				break;
 			}
-			Py_Size(ob) = n;
+			Py_SIZE(ob) = n;
 			for (i = 0; i < size; i++) {
 				int digit = r_short(p);
 				if (digit < 0) {


More information about the Python-3000-checkins mailing list