ãã®é¢æ°ã¯ãã³ã¬ã¼ã¿ã§ãããwithæã³ã³ããã¹ãããã¼ã¸ã£ã®ããã® ãã¡ã¯ããªé¢æ°ã®å®ç¾©ã«å©ç¨ã§ãã¾ãã ãã¡ã¯ããªé¢æ°ãå®ç¾©ããããã«ãã¯ã©ã¹ããã㯠å¥ã®__enter__()ã¨__exit__()ã¡ã½ãããä½ãå¿ è¦ã¯ããã¾ããã ç°¡åãªä¾ï¼å®éã«HTMLãçæããæ¹æ³ã¨ãã¦ã¯ãå§ãã§ãã¾ããï¼ï¼: from __future__ import with_statement from contextlib import contextmanager @contextmanager def tag(name): print "<%s>" % name yield print "</%s>" % name >>> with tag("h1"): ... print "foo" ... <h1> foo </h1> ãã³ã¬ã¼ããããé¢æ°ã¯å¼ã³åºãããã¨ãã«ã¸ã§ãã¬ã¼ã¿-ã¤ãã¬ã¼ã¿ãè¿ãã¾ã
{{#tags}}- {{label}}
{{/tags}}