Ver a proveniência

nodes: Add __contains__ to Template

This allows the use of `key in Template` syntax
pull/252/head
AntiCompositeNumber há 3 anos
ascendente
cometimento
b87f4eef8f
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: A888A323AB506229
1 ficheiros alterados com 3 adições e 0 eliminações
  1. +3
    -0
      mwparserfromhell/nodes/template.py

+ 3
- 0
mwparserfromhell/nodes/template.py Ver ficheiro

@@ -214,6 +214,9 @@ class Template(Node):
"""Alias for :meth:`has`."""
return self.has(name, ignore_empty)

def __contains__(self, name):
return self.has(name)

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



Carregando…
Cancelar
Guardar