Skip to content
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

Add option alias #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add option alias #16

wants to merge 2 commits into from

Conversation

de9uch1
Copy link

@de9uch1 de9uch1 commented Jun 9, 2022

Add option alias setting alias in metadata of dataclass fields.

@de9uch1
Copy link
Author

de9uch1 commented Jun 10, 2022

https://github.com/lebrice/SimpleParsing/blob/ed8170a32e7765bd98ed42831a428f0cdb645b67/simple_parsing/helpers/fields.py#L38

@lebrice
Thank you for your comment.
I've updated pyrallis.field() to be able to pass aliases like SimpleParsing.

@eladrich
Copy link
Owner

Thanks @de9uch1 for the pull request!

We did consider supporting aliases in the past but decided that it goes against the design we are aiming for. Pyrallis currently uses a simple one-to-one mapping between the input arguments and the dataclass fields and we want to keep enforcing that.

@lebrice's SimpleParsing is indeed a great choice if you need alias support or other advanced features.

Keeping this pull request open if you want to discuss further 🙃

@de9uch1
Copy link
Author

de9uch1 commented Jun 15, 2022

Thank you for your reply, @eladrich.

OK, I understand. I think it is a great decision for a simple and consistent design.

I'll decide to create pyrallis-plus, the wrapper of Pyrallis that is added some features at the expense of simplicity.

If there is no problem, I would like to close this PR, is that OK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants