<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 2018-07-25 23:53, David Mertz wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEbHw4ZvoPcuEyzMaaj2ggELi7BBAaQcaGDPCteYQnc5yoe5YA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr">On Wed, Jul 25, 2018, 11:27 PM Chris Angelico
<<a href="mailto:rosuav@gmail.com"
moz-do-not-send="true">rosuav@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
means that you cannot do this:<br>
<br>
>>> NullCoalesce(spam).nil is None<br>
<br>
This IS fundamentally unfixable in a library.<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
Right now, you can still always call .unbox() at the end to get
the underlying value. I agree that's a little ugly, hence why I
added the wrapt proxy stuff. Most operations trigger unboxing,
but indeed not simply echoing to the shell.
<div dir="auto"><br>
</div>
</div>
</blockquote>
<br>
Chris is correct to point out this problem with comparing to None. I
have that problem with my own version of the proxy library, similar
to what David is building: I use the proxy heavily; to the point
where almost any line may be touching a proxy rather than a real
value. To avoid bugs, I disallow "is None" comparisons, mandating
"== None" instead. <br>
<br>
Using unbox() is an alternative, but it is uglier than than
swapping "as" for "==". <br>
<br>
<br>
</body>
</html>