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

Fix _Attrib keys and values are str #99

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

nsoranzo
Copy link
Contributor

not _AnyStr.

>>> from lxml import etree
>>> el = etree.Element("foo", {"t_key": "t_value", b"b_key": b"b_value"})
>>> el.attrib
{'t_key': 't_value', 'b_key': 'b_value'}
>>> type(el.attrib.values()[1])
<class 'str'>

not `_AnyStr`.

```
>>> from lxml import etree
>>> el = etree.Element("foo", {"t_key": "t_value", b"b_key": b"b_value"})
>>> el.attrib
{'t_key': 't_value', 'b_key': 'b_value'}
>>> type(el.attrib.values()[1])
<class 'str'>
```
@scoder
Copy link
Member

scoder commented Jan 27, 2024

Right, return values should be strict. Thanks.

@scoder scoder merged commit fc54574 into lxml:master Jan 27, 2024
6 checks passed
@nsoranzo nsoranzo deleted the attrib_keys_values_str branch January 27, 2024 13:49
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