ifnoneは、coreの関数
def ifnone(a:Any,b:Any)->Any: "`a` if `a` is not None, otherwise `b`." return b if a is None else a
https://github.com/fastai/fastai/blob/master/fastai/core.py
「aがNoneでなければa、そうでなければbです。」
def test_ifnone(): assert ifnone(None, 5) == 5 assert ifnone(5, None) == 5 assert ifnone(1, 5) == 1 assert ifnone(0, 5) == 0
https://github.com/fastai/fastai/blob/master/tests/test_core.py