Comments (7)
To be honest, I think you're better off ignore those errors with "type: ignore" or equivalent. The PyCharm tooling is in error here, and by the looks of it they might fix it soon enough.
from textual.
I don't get that error in my code. The Reactive descriptor is typed so it should allow Mypy to understand the reactive attributes.
Perhaps you have an older version of Mypy? Or maybe its because your on_mount
method isn't typed?
Issues are probably the best place to track bugs. One bug per issues works best.
Although sometimes it will be hard to know what is a bug and what isn't. Usually my benchmark is when behavior contradicts the docs, but since there aren't any docs, it might not be clear! In that case you might want to bring it up on Discussions first. Twitter DMs would be fine for odd questions.
from textual.
PyCharm's lack of support for non-standard or non-class types has been a problem for a while (see https://youtrack.jetbrains.com/issue/PY-27627) but, to stop the annoying warnings, I just changed the type of Reactive objects to 'Reactive[str] | str' (or 'Union[Reactive[str], str]' for those who aren't crazy enough to use 3.10). That technically happens because "BAXI" isn't typed as Reactive[str] but as str.
from textual.
what's that font bro 0_0 it looks sick
from textual.
@willmcgugan Indeed mypy is fine. As @cmckain suggests, this is probably a PyCharm issue (it uses its own analyser it seems). I'm not sure if there is something that could be done about it on Textual side.
@cmckain Just so I understand it right, you made that change in Textual source? I'll probably just disable the PyCharm warning for those lines when/if that project becomes serious enough for my "green mark" OCD to take over.
@kkanekii if you are referring to my screenshot, this is JetBrains Mono, which JetBrains made for their IDEs. I do like it indeed.
from textual.
@abey79 No, just on the variables listed when the subclassed class is created. If the Reactive type does sometimes special, you could always make it so every interaction with the variables in question is done via the Reactive function (so no normal str or ints would be there to cause the warning).
from textual.
Indeed.
from textual.
Related Issues (20)
- Revised progress bar ETA HOT 1
- Reload directory tree and keep state HOT 1
- Increase notification timeout HOT 1
- Possible dev tools and threads issue HOT 3
- Tidy the return type of `App.render` HOT 2
- A single character wide TextArea flickers HOT 3
- cannot find tcss file HOT 4
- Install atexit handler HOT 2
- scroll_to without animation should cancel animation HOT 1
- TextArea theme improvements HOT 1
- Rendering issue with soft hyphens (~~long/wrapped text in `OptionList`~~) HOT 5
- Implement Undo / Redo for TextArea HOT 1
- Implement read only mode in TextArea HOT 1
- Investigate reducing TextArea updates HOT 2
- Type warning with `AwaitComplete` HOT 1
- TextArea docs missing syntax highlighting HOT 5
- test_language_binary_missing test failure when building 0.48.x on Fedora HOT 4
- `ProgressBar` ETA goes adrift if a progress bar is "reused" HOT 2
- Highlight in the suspend example is off by a line HOT 1
- `Option` indexing appears to break after an `OptionList.clear_options` and `OptionList.add_option(s)` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from textual.