다음 코드 조각 문제로 내가 달릴 PHP로 일부 파이썬 코드를 포팅 :의미 "다음 (L에서 C에 대한 C의 경우)"
def getOrAdd(self, config):
h = config.hashCodeForConfigSet()
l = self.configLookup.get(h, None)
if l is not None:
r = next((c for c in l if config.equalsForConfigSet(c)), None)
if r is not None:
return r
if l is None:
l = [config]
self.configLookup[h] = l
else:
l.append(config)
return config
내가 알아낼 수 없습니다, 이게 뭐야?
r = next((c for c in l if config.equalsForConfigSet(c)), None)
을 의미합니다.
아무도 내게이 진술의 감각을 설명 할 수 있습니까?
미리 감사드립니다.
이 예에서'next'는 단지 이해력의 첫 번째 값을 얻는 것입니다. 아니면'None'입니다. –