File: setattr.py

package info (click to toggle)
python-pyforge 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: python: 3,666; makefile: 12; sh: 7
file content (15 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from .queued_object import QueuedObject

class Setattr(QueuedObject):
    def __init__(self, target, name, value, caller_info):
        super(Setattr, self).__init__(caller_info)
        self.target = target
        self.name = name
        self.value = value
    def matches(self, other):
        if not isinstance(other, Setattr):
            return False
        return other.target is self.target and other.name == self.name and other.value == self.value
    def describe(self):
        return "setattr(%r, %r, %r)" % (self.target, self.name, self.value)