DWP previously confirmed its IPv4 block is used and too costly to renumber
itnews.com.au3 ポイント投稿者 forgotusername0 コメント
def update(person, attrs):
pass
def update_with_email(person, attrs):
update(person, attrs)
send_email(person)
Not only is the problem avoided, but a problem of namespace pollution has been fixed too. Overusing keyword arguments in a hyper-generic manner forces extension of the code to require definition of a new function in order to avoid potential breakage. def _real_update_with_email(person, use_html, kwargs):
update(person, **kwargs)
send_email(person, use_html=use_html)
def update_with_email(person, **kwargs):
_real_update_with_email(person, False, kwargs)
def update_with_html_email(person, **kwargs):
_real_update_with_email(person, True, kwargs)
How can the caller dynamically form the attribute names if they need to? # TODO: something seems terribly wrong here, I can't quite put my finger on it.
update(person, **{'previous_' + attr: value})
etc.
Eek, that sounds fun :) Tell us more?