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 comment
Sort by
Date
Votes
Please, file issue with it in PyCharm bug-tracker: https://youtrack.jetbrains.com/issues/PY.
Please sign in to leave a comment.