<div dir="ltr"><div class="gmail_default" style="color:rgb(0,0,0)"><span style="color:rgb(34,34,34)">On Thu, Aug 2, 2018 at 3:39 PM MRAB <<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>> wrote:</span><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In the relevant code, is policy.mangle_from_ ever None?<br></blockquote><div><br></div><div class="gmail_default" style="color:rgb(0,0,0)">That's impossible to know, since the initializer where this code originally appears puts no constraints on the value of 'policy', it's just assumed to have a 'mangle_from_' member...  I would be paranoid and assume, yes, it can take on a value of None as there's nothing to indicate that it can't.</div><div class="gmail_default" style="color:rgb(0,0,0)"><div class="gmail_default"><br></div><div class="gmail_default">class Generator:</div><div class="gmail_default">...</div><div>    def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, *,<br></div></div><div class="gmail_default" style="color:rgb(0,0,0)">                 policy=None):</div><div class="gmail_default" style="color:rgb(0,0,0)">...</div><div class="gmail_default" style="color:rgb(0,0,0)">        if mangle_from_ is None:</div><div class="gmail_default" style="color:rgb(0,0,0)">            mangle_from_ = True if policy is None else policy.mangle_from_</div><div class="gmail_default" style="color:rgb(0,0,0)">        self._fp = outfp</div><div class="gmail_default" style="color:rgb(0,0,0)">        self._mangle_from_ = mangle_from_</div></div></div>