Comments (1)
Your second method would indeed be how it should work.
As it is currently, argument decorators flat out ignore anything indicated on their first parameter, because it is entirely determined by the parameter that was originally annotated:
# clize never looks at this
@argument_decorator
def level_2(arg, b):
...
# `arg`'s annotation is ignored
@argument_decorator
def level_1(arg: level_2, a):
...
# The specifics of `param` (e.g. it being an option/named parameter) completely override anything supplied by `level_1`.
def main(*, param: level_1):
...
I'll see if some special handling can be done for argument_decorator
, else this will have to wait until #24
from clize.
Related Issues (20)
- Use `Annotated` to add aliases to options HOT 4
- Errors when using dictionnary to specify alternate commands HOT 3
- Any way to give negative number as argument ? HOT 1
- [Bug] ValueError: path is on mount 'C:', start on mount 'D:' HOT 3
- [Question] Disable print(), if --help HOT 1
- Case-sensitive 1-character aliases are not allowed HOT 2
- How to support custom types and typing? HOT 4
- Support for Google Style Python Docstrings HOT 1
- make pathlib.Path a first citizen by adding default converter HOT 4
- Add intro for `repeated_test` in contribution guidelines
- KeyError when decorator rewrites varargs HOT 1
- Docs do not mention setup or setup.py
- Is this project still alive? HOT 1
- Missing 4.1.1 release HOT 1
- Requesting support for automatic shell completion
- Allow the creation of command aliases HOT 4
- Any issue with `attrs>=20.0.0`? HOT 2
- Proposing a PR to fix a few small typos
- repeated_test no longer compatible with 3.10 HOT 2
- What is going wrong here? HOT 2
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 clize.