Changeset 2759:e47eef843823 in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/04/07 17:40:28 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Make IsInstanceSelector?(foo)[bar] work by returning the appropriate
nthoftype selector.

Finish makeselector->makewalkfilter renaming.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/xfind.py

    r2758 r2759  
    5858 
    5959    def __div__(self, other): 
    60         return ChildCombinator(self, makeselector(other)) 
     60        return ChildCombinator(self, makewalkfilter(other)) 
    6161 
    6262    def __floordiv__(self, other): 
    63         return DescendantCombinator(self, makeselector(other)) 
     63        return DescendantCombinator(self, makewalkfilter(other)) 
    6464 
    6565    def __mul__(self, other): 
    66         return AdjacentSiblingCombinator(self, makeselector(other)) 
     66        return AdjacentSiblingCombinator(self, makewalkfilter(other)) 
    6767 
    6868    def __pow__(self, other): 
    69         return GeneralSiblingCombinator(self, makeselector(other)) 
     69        return GeneralSiblingCombinator(self, makewalkfilter(other)) 
    7070 
    7171    def __and__(self, other): 
    72         return AndCombinator(self, makeselector(other)) 
     72        return AndCombinator(self, makewalkfilter(other)) 
    7373 
    7474    def __or__(self, other): 
    75         return OrCombinator(self, makeselector(other)) 
     75        return OrCombinator(self, makewalkfilter(other)) 
    7676 
    7777    def __invert__(self): 
     
    9595            return IsInstanceSelector(*(self.types+other.types)) 
    9696        return Selector.__or__(self, other) 
     97 
     98    def __getitem__(self, index): 
     99        return nthoftype(index, *self.types) 
    97100 
    98101    def __repr__(self):