Replies: 1 comment
-
|
I take your point, and it's kind of consistent with shortcuts we do elsewhere. But if we did this, we'd need to have an origin (so you could make a relative name and a codec (i.e. the other |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Upfront apologies! This might very well be a bad idea and is definitelly a breaking change, but it is an itch I want to scratch so bad I will propose it anyway.
Perceived problem
For me, one of least ergonomic parts of API I use every day is
dns.name.from_text("something.test."), which is veeeery long. My options without changing dnspython are:from dns.name import from_text- ambiguous for causal reader and still longfrom dns.name import from_text as ft- even worsestrargument specially and do equivalent offrom_texton itAll of them are totally doable but it causes proliferation of hacks in all scripts using Name objects as I and my coworkers rarely want to have
dns.name.from_text()all over the place.The Bad Idea
Change Name
__init__()to special-case arguments of typestr. Something along those lines:This would allow a consistent 'shorthand' to be used across all projects:
I did not explore all implications, but I hope it explains the idea.
Beta Was this translation helpful? Give feedback.
All reactions