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

Cardinality support #181

Open
fliiiix opened this issue Mar 15, 2024 · 2 comments
Open

Cardinality support #181

fliiiix opened this issue Mar 15, 2024 · 2 comments

Comments

@fliiiix
Copy link

fliiiix commented Mar 15, 2024

For radish we wrongly documented that it is possible to combine the standard types from parse with a cardinality

These standard types can be combined with the following cardinalities:
"{numbers:d}" #< Cardinality: 1 (one; the normal case)
"{number:d?}" #< Cardinality: 0..1 (zero or one = optional)
"{numbers:d*}" #< Cardinality: 0..* (zero or more = many0)
"{numbers:d+}" #< Cardinality: 1..* (one or more = many)

Which might have worked somehow or maybe according to my digging was wrong since the start.
radish-bdd/radish#130

Now parse itself does obviously not support any cardinality functions but parse_type from @jenisys does.
But it seems that parse_type is not able to add cardinality to the default types because of the design of parse

The information for the built-in types in the parse module are deeply embedded in the implementation and not easily accessible.
jenisys/parse_type#9 (comment)

My question would be if there is any interest in making the built-in types more accessible in a way parse_type could consume?

@wimglenn
Copy link
Collaborator

wimglenn commented Mar 15, 2024

Well, since there is an easy workaround (stick to user-defined types) and there has not been much interest since those 2017 issues... If someone can do it in a clean and tested way I'm not against the idea, but I'm not too interested in working on this myself as a maintainer.

@fliiiix
Copy link
Author

fliiiix commented Mar 20, 2024

Perfect i linked this issue from radish documentation, if someone wants support for that they should contribute that :D I assume there are a few users a year which would like to use that but as it is simpler for everyone to work around it i assume that's what most of them do

if i find time i will give it a try but this also has very low prio for me personally

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

No branches or pull requests

2 participants