Skip to content

[#835] allow key-agnostic iRODSMeta construction for AVU assignments - #836

Open
d-w-moore wants to merge 16 commits into
irods:mainfrom
d-w-moore:835.m
Open

d-w-moore wants to merge 16 commits into
irods:mainfrom
d-w-moore:835.m

Conversation

@d-w-moore

Copy link
Copy Markdown
Collaborator

No description provided.

@d-w-moore
d-w-moore marked this pull request as draft September 14, 2026 15:54
@d-w-moore d-w-moore changed the title #835 allow key-agnostic iRODSMeta construction for AVU assignments [#835] allow key-agnostic iRODSMeta construction for AVU assignments Sep 14, 2026
@d-w-moore
d-w-moore marked this pull request as ready for review September 14, 2026 19:04
@d-w-moore
d-w-moore marked this pull request as ready for review September 15, 2026 16:38
@d-w-moore

Copy link
Copy Markdown
Collaborator Author

ready for review. Until review comments are seen, the changes from here on will be only for codacy/ruff and other minor modifications as needed.

Comment thread irods/test/meta_test.py
Comment thread irods/meta.py Outdated

@MartinFlores751 MartinFlores751 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is looking good to me, only have one suggestion. Learned about the := operator.

Comment thread irods/test/meta_test.py Outdated
# Set a number of metadata AVUs with the iRODSMeta builder invocation. (Each of
# these AVU values follow a predictable relation defined by the test_mapping function.)
def test_mapping(name): return str(ord(name))
avu_names = [chr(_) for _ in range(ord('a'), ord('z')+1)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style question. Is it preferable to use _ here? I thought _ was equivalent to "discard this result" and was a bit surprised to see it work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_ is a valid dummy variable name, so our tools like it better than having a meaningfule variable like loopVariable because, you know, namespace pollution. Of course it's also true as of Python 3.x that list comprehension temporaries do not leak outward, so ... really we can choose anything.

_ , in the interpreter, means "last result". Other than that , I don't think there's any special meaning....

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style question. Is it preferable to use _ here? I thought _ was equivalent to "discard this result" and was a bit surprised to see it work.

now that I look at it though, [ letter for letter in string.ascii_lowercase ] might be more self-documenting - ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_ is a valid dummy variable name, so our tools like it better than having a meaningfule variable like loopVariable because, you know, namespace pollution. Of course it's also true as of Python 3.x that list comprehension temporaries do not leak outward, so ... really we can choose anything.

_ , in the interpreter, means "last result". Other than that , I don't think there's any special meaning....

Learned a lot about how _ is treated and scoping behavior here. Thanks for the info!

Style question. Is it preferable to use _ here? I thought _ was equivalent to "discard this result" and was a bit surprised to see it work.

now that I look at it though, [ letter for letter in string.ascii_lowercase ] might be more self-documenting - ?

Definitely like self-documenting code. If you think it'll help future readers, I'd change _ to letter.

Comment thread irods/test/meta_test.py
Comment thread irods/test/meta_test.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants