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 emission lines to NXxas #12

Closed
wants to merge 1 commit into from
Closed

Add emission lines to NXxas #12

wants to merge 1 commit into from

Conversation

mretegan
Copy link
Contributor

No description provided.

@newville
Copy link
Member

@mretegan Thanks. I'm not sure where the errors coming from. Could it be because although "K-L1" is a valid member of the Enum that could be found by dictionary or attribute access, it can't be accessed as an attribute

>>> from enum import StrEnum
>>> senums  = StrEnum('thing', {'Valid': 'Thing', 'Non-Attrr': 'value 2', 'Also Trouble': 'value 3'})
>>> senums.Valid
<thing.Valid: 'Thing'>
>>> print(senums.Valid)
Thing
>>> print(senums.Non-Attr)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    raise AttributeError(name) from None
AttributeError: Non
>>> senums.Non-Attr

>>> senums.Also Trouble
  File "<stdin>", line 1
    senums.Also Trouble
                ^^^^^^^
SyntaxError: invalid syntax
>>> getattr(senums, 'Also Trouble')
<thing.Also Trouble: 'value 3'>

Maybe we should use a plain list of strings here, especially as StrEnum is only valid in Python 3.11 and later?

@mretegan
Copy link
Contributor Author

I am closing this one as it is not relevant to the new definitions. The discussion will be continued in #16.

@mretegan mretegan closed this Jan 20, 2025
@mretegan mretegan deleted the add-emission-lines branch January 22, 2025 07:46
@mretegan mretegan restored the add-emission-lines branch January 22, 2025 07:46
@mretegan mretegan deleted the add-emission-lines branch January 22, 2025 08:25
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.

2 participants