Procházet zdrojové kódy

fix: define `__slots__` to avoid `__dict__` creation

version-14
Sagar Vora před 3 roky
rodič
revize
d2dfc8c335
1 změnil soubory, kde provedl 4 přidání a 5 odebrání
  1. +4
    -5
      frappe/__init__.py

+ 4
- 5
frappe/__init__.py Zobrazit soubor

@@ -55,20 +55,19 @@ controllers = {}
class _dict(dict):
"""dict like object that exposes keys as attributes"""

__slots__ = ()
__getattr__ = dict.get
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
__setstate__ = dict.update

def __getstate__(self):
return self

def __setstate__(self, d):
self.update(d)

def update(self, d):
def update(self, *args, **kwargs):
"""update and return self -- the missing dict feature in python"""

super().update(d)
super().update(*args, **kwargs)
return self

def copy(self):


Načítá se…
Zrušit
Uložit