[BUG] No `Optional` typing in args that accept `None` in `Console`.
See original GitHub issueSome arguments to rich.console.Console
—like width
—accept None
as an argument and are documented as Optional
but are typed as only int
, raising some type checking errors if width=None
is passed.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[BUG] No `Optional` typing in args that accept `None` in `Console ...
Some arguments to rich.console.Console—like width—accept None as an argument and are documented as Optional but are typed as only int, raising some type...
Read more >Python 3.10+: Optional[Type] or Type | None - Stack Overflow
, which declares that this is a required argument where None is one of the valid argument value.
Read more >argparse — Parser for command-line options, arguments and ...
For a more gentle introduction to Python command-line parsing, have a look at the argparse tutorial. The argparse module makes it easy to...
Read more >Python Type Checking (Guide) - Real Python
In this guide, you'll look at Python type checking. Traditionally, types have been handled by the Python interpreter in a flexible but implicit...
Read more >Kinds of types - mypy 0.991 documentation
def show_heading(s) -> None: print('=== ' + s + ' ===') # No static type ... The type of a function that accepts...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s somewhat irritating to have a convenient feature added only to have it taken away. However since it looks like you’ve done the work, I have no issue with changing it.
If you’re interested, #1182 attempts to impliment the
Optional
typing throughout Rich.