소스 검색

nodes: Add __contains__ to Template

This allows the use of `key in Template` syntax
pull/252/head
AntiCompositeNumber 3 년 전
부모
커밋
b87f4eef8f
No known key found for this signature in database GPG 키 ID: A888A323AB506229
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. +3
    -0
      mwparserfromhell/nodes/template.py

+ 3
- 0
mwparserfromhell/nodes/template.py 파일 보기

@@ -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*.



불러오는 중...
취소
저장