Kaynağa Gözat

nodes: Use def instead of assignment of a lambda in Template

Per PEP8, there is no benefit to using a lambda here, and some
downsides. It's the same number of SLOC either way, so might as well
change it.
pull/252/head
AntiCompositeNumber 3 yıl önce
ebeveyn
işleme
204266c3df
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: A888A323AB506229
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. +3
    -3
      mwparserfromhell/nodes/template.py

+ 3
- 3
mwparserfromhell/nodes/template.py Dosyayı Görüntüle

@@ -210,9 +210,9 @@ class Template(Node):
return True
return False

has_param = lambda self, name, ignore_empty=False: \
self.has(name, ignore_empty)
has_param.__doc__ = "Alias for :meth:`has`."
def has_param(self, name, ignore_empty=False):
"""Alias for :meth:`has`."""
return self.has(name, ignore_empty)

def get(self, name, default=_UNSET):
"""Get the parameter whose name is *name*.


Yükleniyor…
İptal
Kaydet