Fixed / overloading when enabling true division. frederic@jolliton.com--2005-main,tx--main--0.1
authorFrederic Jolliton <frederic@jolliton.com>
Wed, 1 Mar 2006 08:32:37 +0000 (08:32 +0000)
committerFrederic Jolliton <frederic@jolliton.com>
Wed, 1 Mar 2006 08:32:37 +0000 (08:32 +0000)
 * When importing division from __future__ the / operator become
   __truediv__ instead of __div__. Node now handle both of them. This
   operator is overloaded to provide a "nicer" XPath access.
git-archimport-id: frederic@jolliton.com--2005-main/tx--main--0.1--patch-52

nodes.py

index 4701490..fcb216c 100644 (file)
--- a/nodes.py
+++ b/nodes.py
@@ -313,10 +313,18 @@ class Node( object ) :
 
                return self.__getitem__( path )
 
+       def __truediv__( self , path ) :
+
+               return self.__getitem__( path )
+
        def __idiv__( self , other ) :
 
                raise NotImplementedError
 
+       def __itruediv__( self , other ) :
+
+               raise NotImplementedError
+
        def valueOf( self , path ) :
 
                sequence = self.xpath( path )