Unresolved attribute with argparse
When creating an app using argparse and python 3.4 I get a lot of "Unresolved attribute reference" errors.
Is there any way to fix this?
class Demo:
def __init__(self):
self.parser.add_argument('test', type=int, choices=range(0,2), help='pick a number')
# Add all arguments to the local namespace
self.parser.parse_args(namespace=self)
if __name__ == '__main__':
new = Demo()
# this will generate the error
print(new.test)
Is there any way to fix this?
class Demo:
def __init__(self):
self.parser.add_argument('test', type=int, choices=range(0,2), help='pick a number')
# Add all arguments to the local namespace
self.parser.parse_args(namespace=self)
if __name__ == '__main__':
new = Demo()
# this will generate the error
print(new.test)
1 条评论
排序方式
日期
投票数
Please, file issue with it in PyCharm bug-tracker: https://youtrack.jetbrains.com/issues/PY.
请先登录再写评论。