Arek Bulski wrote:
def __glob_eq__(a,b):
if not a == b:
raise FoundInequalityError(a,b)
return True
assert obj1 == obj2 #<-- using eq above
How would you ensure that this overriding only applied in
the places you want it? You don't want to change the meaning
of == in the code
On Sun, Sep 18, 2016 at 8:06 AM, Ethan Furman wrote:
> Just like Python will use the defined __ne__ if
> it's present, or fall back to negating the result of __eq__ if __ne__ is
> not present, I see __divmod__ working the same way:
>
> - is __mod__ present? use it
> - is
I am using declarative testing a lot and I found out why unit tests are so
clunky. The reason why assertEquals(a,b) is used is because if we put
`assert a==b` then nose can catch the AssertionError but wont find out what
was returned or expected. This could be easily overcome if we allow
On 09/17/2016 03:14 PM, Chris Angelico wrote:
On Sun, Sep 18, 2016 at 8:06 AM, Ethan Furman wrote:
Just like Python will use the defined __ne__ if
it's present, or fall back to negating the result of __eq__ if __ne__ is
not present, I see __divmod__ working the same way:
- is __mod__
On 9/17/2016 6:51 AM, João Matos wrote:
Hello,
I would like to suggest adding a clear command (not function) to Python.
It's simple purpose would be to clear the REPL screen, leaving the >>>
prompt at the top left of the screen.
This is something very basic but also very useful for newbies
Hello,
I searched and found several possible solutions to clear the screen in
the CPython REPL, but all are, in my opinion, complex for a newbie.
The existence of a clear command would be a simple and obvious,
therefore accessible to newbies.
Best regards,
JM
On 17-09-2016 14:34, eryk
Hello,
I know about those IPython commands and I searched and found several
possible solutions to clear the screen in the CPython REPL, but all are,
in my opinion, complex for a newbie.
The existence of a clear command would be simple and obvious, therefore
accessible to newbies.
Best
On Sat, Sep 17, 2016 at 1:15 PM, Wes Turner wrote:
> !cls #windows
cmd's built-in cls command doesn't clear just the screen, like a VT100
\x1b[1J. It clears the console's entire scrollback buffer. Unix
`clear` may also work like that. With GNOME Terminal in Linux, `clear`
It seems like this could be something similar to `functools.total_ordering`
and decorate a class. In principle that transformation could go in either
direction, but only if the decorator is used.
On Sat, Sep 17, 2016 at 3:56 AM, Mark Dickinson wrote:
> On Sat, Sep 17, 2016
On Sun, Sep 18, 2016 at 3:57 AM, David Mertz wrote:
> For example, '%' is fairly widely (ab)used for meanings other than modulo.
> E.g. string formatting. Probably not that many classes that respond to '%'
> to do something non-modulo simultaneously implement `.__divmod__()` ...
Thank you all!
אלעזר
(AKA Elazar)
On Sat, Sep 17, 2016 at 4:53 AM Steven D'Aprano wrote:
> On Sat, Sep 17, 2016 at 03:39:08AM +1000, Chris Angelico wrote:
> > On Fri, Sep 16, 2016 at 11:22 PM, אלעזר wrote:
> > > P.S. how do I change the name in my
11 matches
Mail list logo