Re: [Python-Dev] PEP 572: Assignment Expressions

2018-04-20 Thread Robert Smallshire
If you restrict the idea to 'if' and 'while', Why not render this using the existing 'as' form for binding names, already used with 'except' and 'with': while learner.get(static_hint) as points: learner.feed(f(points)) The equivalent for 'if' helps with the regex matching case:

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-27 Thread Robert Smallshire
t;>> >>> ) >> > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/rob%40sixty-nort

Re: [Python-Dev] Deprecating float.is_integer()

2018-03-22 Thread Robert Smallshire
ent that a putative complex.is_integral() should therefore return False, but I expect that would get even less support than the other suggestions in these threads. *Robert Smallshire | *Managing Director *Sixty North* | Applications | Consulting | Training r...@sixty-north.com | T +47 63 01 04 44 | M +47 924

Re: [Python-Dev] Deprecating float.is_integer()

2018-03-21 Thread Robert Smallshire
Here's an excerpted (and slightly simplified for consumption here) usage of float.is_integer() from the top of a function which does some convolution/filtering in a geophysics application. I've mostly seen it used in guard clauses in this way to reject either illegal numeric arguments directly, or

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-21 Thread Robert Smallshire
As requested on the bug tracker, I've submitted a pull request for is_integer() support on the other numeric types. https://github.com/python/cpython/pull/6121 These are the tactics I used to implement it: - float: is_integer() already exists, so no changes - int: return True - Real: return x