Comments (5)
@janluke Just curious, is there anything in particular you are worried about with moving super().__init__
to the beginning? Or just being cautious?
from cloup.
A more conservative fix would be to leave it where it is and add at the beginning of __init__
the following.
self.chain = kwargs.get("chain", None)
del kwargs["chain"]
It seems like a bit of a kludge though. Overall, I noticed that re Cloup types, sometimes you are calling super().__init__
at the start, sometimes at the end, and at least once somewhere in the middle.
from cloup.
@janluke Just curious, is there anything in particular you are worried about with moving super().init to the beginning? Or just being cautious?
Just being cautious. I don't remember why I put the super() call at the end. Moving the call at the beginning is probably something safe to do. Still, "formally" it deserves to be its own PR because if someone who used SectionMixin
directly may have relied on this. Pragmatically, very few people (if any) use these mixins directly, so it's just a formality.
from cloup.
@janluke Makes sense. Want me to create a PR?
from cloup.
It'd be great! Thanks :)
from cloup.
Related Issues (20)
- Rename `GroupedOption` to `Option` and keep it as an alias
- Support option groups and constraints in Group by removing `BaseCommand` and making `Group` inherit from `Command`
- Drop support to Python 3.6 and test for 3.10 HOT 1
- AnySet/AllSet throws AttributeError HOT 5
- Mypy fails in strict mode HOT 5
- Minor language issue in documentation HOT 3
- Optional parenthesis for `@command` and `@option` HOT 5
- Require one constraint prevents subcommand help from working HOT 5
- Consider renaming __constraints to __cloup_constraints__ HOT 4
- Test for Python 3.11
- Pytest: replace deprecated `pytest.warns(None)` with something else
- Rename `sorted` attribute of `Section` to `is_sorted` to solve conflict with `Section.sorted` static method HOT 6
- Use ruff and a code formatter HOT 1
- mutually_exclusive constraint doesn't work with multiple flags with flag_value HOT 1
- Styling of aliases HOT 1
- Custom MultiCommands (with styling) HOT 3
- Over-highlighting of heading's extra space HOT 2
- Change `HelpTheme` type to allow sub-classing HOT 3
- `cloup.Group` ignores `command_class` to produce sub-commands HOT 9
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 cloup.