Package logilab :: Package common :: Module registry :: Class Predicate

[frames] | no frames]

# Class Predicate

source code

    object --+
             |
            Predicate

    base class for selector classes providing implementation
    for operators ``&``, ``|`` and  ``~``

    This class is only here to give access to binary operators, the selector
    logic itself should be implemented in the :meth:`__call__` method. Notice it
    should usually accept any arbitrary arguments (the context), though that may
    vary depending on your usage of the registry.

    a selector is called to help choosing the correct object for a
    particular context by returning a score (`int`) telling how well
    the implementation given as first argument fit to the given context.

    0 score means that the class doesn't apply.

Instance Methods

func_name(self) | source code

search_selector(self, selector) search for the given selector, selector instance or tuple of selectors in the selectors tree. | source code

__str__(self) str(x) | source code

__and__(self, other) | source code

__rand__(self, other) | source code

__iand__(self, other) | source code

__or__(self, other) | source code

__ror__(self, other) | source code

__ior__(self, other) | source code

__invert__(self) | source code

__call__(self, cls, *args, **kwargs) | source code

__repr__(self) repr(x) | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__init__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `object`: `__class__`

Method Details

### func_name(self)

source code

Decorators:
  - `@property`

### search_selector(self, selector)

source code

    search for the given selector, selector instance or tuple of
    selectors in the selectors tree. Return None if not found.

### __str__(self)
(Informal representation operator)

source code

str(x)

Overrides: object.__str__
  (inherited documentation)

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)