Skip to content

Convert argument to appropriate type #100916

Closed
@huang06

Description

@huang06

Documentation

https://docs.python.org/3/howto/logging-cookbook.html#use-of-contextvars

The argument count should be converted to integer type if user passes value to main.py.

$ python3 main.py --count 100

Traceback (most recent call last):
  File "/home/tom/main.py", line 138, in <module>
    main()
  File "/home/tom/main.py", line 117, in main
    for i in range(options.count):
TypeError: 'str' object cannot be interpreted as an integer

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions