Opened 4 years ago
#6778 enhancement new
Provide dns Message and EDNSMessage constructors which accept FlagConstants and ValueConstants
|Reported by:||Richard Wall||Owned by:|
In ticket:5675#comment:16 exarkun wrote:
- Earlier you mentioned an idea about improving the handling of these numerous flags. I think that's a good idea to pursue. Consider this idea (not necessarily for this ticket, since making these APIs private means we have plenty of time to improve them with follow-up work) -
__init__should accept a
FlagConstantcollapsing as many of these flags as possible (looks like there are 8 parameters that would all combine into 1) into a single value. We could also think about whether
ednsVersionmerit more special handling (perhaps a
Valuesconstant instead of
int) and For compatibility,
- provide an alternate constructor with a signature more like its current
__init__signature - this would be an API more like a drop-in replacement for
Message.__init__. This can also include whatever extra safety checks seem useful to help developers avoid subtle mistakes (though hopefully we can also encourage them to switch to the nicer API).
Change History (0)
Note: See TracTickets for help on using tickets.