소스 검색

add __contains__

master
whut 1 년 전
부모
커밋
8e1237f90c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. +6
    -0
      src/confthing/__init__.py

+ 6
- 0
src/confthing/__init__.py 파일 보기

@@ -68,3 +68,9 @@ class Config:
def __setitem__(self, path, value):
self.set(path, value, self.clobber_subscript)

def __contains__(self, path):
try:
self.get(path, strict=True)
return True
except:
return False

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