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
Confusing docstring on dns.Set #1063
Comments
I can see that some classes override the Set methods, perhaps we could do: class Test(set): # <-- inherits from set
def add(self, __element) -> None:
super().add(5)
return super().add(__element)
x = Test()
x.add(3)
print(x)
# Test({3, 5}) |
We can fix the docstring, but we are stuck with non-native sets for backwards compatibility reasons until dnspython 3.0 at least. As the comment says, the API was designed before there even were sets in Python, and there is lots of code in the wild assuming you can subscript an RRset, especially with [0]. |
Documentation improved. |
Alright! Thank you for your time and understanding. Ping me whenever you start accepting donations. |
Describe the bug
The docstring says "these sets are based on lists and are thus indexable".
Specifically,
My personal recommendation would be to use Python standard set and not to reinvent the wheel. The CPython sets are very well optimized for both CPU and memory usage. It will also reduce code maintenance and package installation size 🙂.
Context:
The text was updated successfully, but these errors were encountered: