[Lxml-checkins] r46621 - lxml/trunk/src/lxml
scoder at codespeak.net
scoder at codespeak.net
Sat Sep 15 12:05:12 CEST 2007
Author: scoder
Date: Sat Sep 15 12:05:02 2007
New Revision: 46621
Modified:
lxml/trunk/src/lxml/etree.pyx
lxml/trunk/src/lxml/objectify.pyx
Log:
cleanup in init code (requires Cython)
Modified: lxml/trunk/src/lxml/etree.pyx
==============================================================================
--- lxml/trunk/src/lxml/etree.pyx (original)
+++ lxml/trunk/src/lxml/etree.pyx Sat Sep 15 12:05:02 2007
@@ -1,17 +1,13 @@
cimport tree, python, config
from tree cimport xmlDoc, xmlNode, xmlAttr, xmlNs, _isElement, _getNs
-from python cimport isinstance, issubclass, hasattr, getattr, callable
-from python cimport iter, repr, str, _cstr, _isString, Py_ssize_t
+from python cimport issubclass, callable
+from python cimport _cstr, _isString
cimport xpath
cimport xinclude
cimport c14n
cimport cstd
import __builtin__
-cdef object True
-cdef object False
-True = __builtin__.True
-False = __builtin__.False
cdef object set
try:
@@ -19,14 +15,6 @@
except AttributeError:
from sets import Set as set
-cdef object id
-id = __builtin__.id
-cdef object super
-super = __builtin__.super
-
-cdef object StopIteration
-StopIteration = __builtin__.StopIteration
-
del __builtin__
cdef object _elementpath
Modified: lxml/trunk/src/lxml/objectify.pyx
==============================================================================
--- lxml/trunk/src/lxml/objectify.pyx (original)
+++ lxml/trunk/src/lxml/objectify.pyx Sat Sep 15 12:05:02 2007
@@ -1,8 +1,7 @@
from etreepublic cimport _Document, _Element, ElementBase
from etreepublic cimport _ElementIterator, ElementClassLookup
from etreepublic cimport elementFactory, import_etree, textOf
-from python cimport str, repr, isinstance, issubclass, callable, getattr
-from python cimport _cstr, Py_ssize_t
+from python cimport callable, issubclass, _cstr
cimport etreepublic as cetree
cimport python
cimport tree
@@ -17,50 +16,19 @@
cdef object re
import re
+
cdef object __builtin__
import __builtin__
-cdef object int
-int = __builtin__.int
-cdef object long
-long = __builtin__.long
-cdef object float
-float = __builtin__.float
-cdef object bool
-bool = __builtin__.bool
-cdef object pow
-pow = __builtin__.pow
-cdef object abs
-abs = __builtin__.abs
-cdef object len
-len = __builtin__.len
-
-cdef object True
-True = __builtin__.True
-cdef object False
-False = __builtin__.False
-
-cdef object AttributeError
-AttributeError = __builtin__.AttributeError
-cdef object TypeError
-TypeError = __builtin__.TypeError
-cdef object ValueError
-ValueError = __builtin__.ValueError
-cdef object IndexError
-IndexError = __builtin__.IndexError
-cdef object StopIteration
-StopIteration = __builtin__.StopIteration
-
-cdef object IGNORABLE_ERRORS
-IGNORABLE_ERRORS = (ValueError, TypeError)
-cdef object list
-list = __builtin__.list
cdef object set
try:
set = __builtin__.set
except AttributeError:
from sets import Set as set
+cdef object IGNORABLE_ERRORS
+IGNORABLE_ERRORS = (ValueError, TypeError)
+
cdef object islice
from itertools import islice
More information about the lxml-checkins
mailing list