Skip to content

[ENH]: Define and enforce criteria for legal labels in game representation #944

Description

@tturocy

Now that we insist on labels for many objects within a game, we should define what a legal label is.

For version 16.7, we propose that a legal label satisfies the following:

  • Consists only of printable ASCII characters or spaces
  • The first and last character of the label must be printable
  • Other whitespace or non-printable characters are not acceptable
  • Two or more consecutive spaces are not permitted

This should be added as a check and enforced at the C++ level, to ensure uniformity. This will have implications for the checks in pygambit (see discussion in PR #942).

We also want to centralise this checking because in 17.0 we will allow Unicode labels more generally (see #862). At the moment Unicode labels sometimes work but largely by accident if they do. Therefore our approach will be first to ensure validity of labels and then this will make it easier to expand that definition (as opposed to our current approach which is inconsistent across different sites).

Metadata

Metadata

Assignees

Labels

c++Items which involve writing in C++cythonItems which involve coding in Cython

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions