`dir` is a reserved Python keyword; better to use another name.