Skip to content

openpyxl: tag attr can be callable #14208

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

Closed
wants to merge 1 commit into from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Jun 1, 2025

As noticed in #11841 (comment)

The tag can actually be a str OR a callable.
The only place the tag attribute isn't for a comparison (equal, contains, itemgetter, ...) is: https://foss.heptapod.net/openpyxl/openpyxl/-/blob/700cafe4928c9c5e7ffc998f5d911e475ac8c37f/openpyxl/descriptors/serialisable.py#L76
And that's after being passed through the localname function [where it simply checks if it's a callable]: https://foss.heptapod.net/openpyxl/openpyxl/-/blob/700cafe4928c9c5e7ffc998f5d911e475ac8c37f/openpyxl/xml/functions.py#L77-81

Copy link
Contributor

github-actions bot commented Jun 1, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Avasam
Copy link
Collaborator Author

Avasam commented Jun 1, 2025

Right hum... I don't think there's a clean or easy way to do what I'm trying to here. So maybe just keeping the status-quo for now.

@Avasam Avasam closed this Jun 1, 2025
@Avasam Avasam deleted the openpyxl-tag-attr-can-be-callable branch June 1, 2025 02:51
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.

1 participant