Skip to content

Convert argument to appropriate type #100916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
huang06 opened this issue Jan 10, 2023 · 0 comments
Closed

Convert argument to appropriate type #100916

huang06 opened this issue Jan 10, 2023 · 0 comments
Labels
docs Documentation in the Doc dir

Comments

@huang06
Copy link
Contributor

huang06 commented Jan 10, 2023

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

@huang06 huang06 added the docs Documentation in the Doc dir label Jan 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 10, 2023
vsajip pushed a commit that referenced this issue Jan 10, 2023
vsajip pushed a commit that referenced this issue Jan 10, 2023
@vsajip vsajip closed this as completed Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants