File: fake_module_with_collection_getattribute.py

package info (click to toggle)
astroid 4.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,132 kB
  • sloc: python: 38,560; makefile: 24
file content (11 lines) | stat: -rw-r--r-- 313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
class Changer:
    def __getattribute__(self, name):
        list_collection.append(self)
        set_collection.add(self)
        dict_collection[self] = self
        return object.__getattribute__(self, name)


list_collection = [Changer()]
set_collection = {Changer()}
dict_collection = {Changer(): Changer()}