<br><br><div class="gmail_quote">On Wed, May 2, 2012 at 2:50 PM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org" target="_blank">barry@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On May 02, 2012, at 08:32 PM, Martin v. Löwis wrote:<br>
<br>
>Both, actually. I had expected that new API (i.e. a new method of some kind)<br>
>would be necessary, so it has elegance that this is not required. OTOH,<br>
>explicit type checking is despised in the OO world, and varying result types<br>
>are disliked by Guido van Rossum (not sure whether this reservation applies<br>
>to this case as well, or only to cases where the return type depends on the<br>
>parameter types).<br>
<br>
</div>My understanding (and I'm sure Guido will correct me if I'm wrong) is that<br>
it's the latter: return type should not depend on function argument values.</blockquote><div><br></div><div>This is how I interpreted Guido's preference (e.g. return bytes or str based on whether an argument(s) is bytes or str).</div>
</div>