On 7/27/20 5:00 PM, Christopher Barker wrote:
I guess this is the part I find confusing:
when (and why) does __eq__ play a role?
__eq__ is the final authority on whether two objects are equal. The
default __eq__ punts and used identity.
On Mon, Jul 27, 2020 at 12:01 PM Ethan Furman
I guess this is the part I find confusing:
when (and why) does __eq__ play a role?
On Mon, Jul 27, 2020 at 12:01 PM Ethan Furman wrote:
> Equal objects must have equal hashes.
> Objects that compare equal must have hashes that compare equal.
>
OK got it.
However, not all objects with the
On Mon, 27 Jul 2020 at 23:24, Vinay Sharma wrote:
>
> Hi, Thanks for replying.
>
> > One thing that is worth thinking about is the safety of the API that
> > is put together. A memory segment plus a separate detached semaphore
> > or mutex can be used to build a safe API, but is not itself a safe
On 7/27/20 10:01 AM, Peter Moore wrote:
> I have had a long standing unanswered question on on stackoverflow: is it
> possible to pass a function to a default parameter so that you could do in
> essence things like this.
>
> def time_diff(target_time, curr_time= lambda : datetime.now() ):
>
On 7/27/20 11:15 AM, Christopher Barker wrote:
On Sun, Jul 26, 2020 at 8:25 PM Guido van Rossum wrote:
In fact, defining `__hash__` as returning the constant `42` is
better, because it is fine if two objects that *don't* compare equal
still have the same hash value (but not the other way
On Sun, Jul 26, 2020 at 8:25 PM Guido van Rossum wrote:
> The only reason I can think of why you are so resistant to this would be
> due to poor development practices, e.g. adding tests long after the "main"
> code has already been deployed, or having a separate team write tests.
>
and even
On 27.07.20 16:01, Peter Moore wrote:
I have had a long standing unanswered question on on stackoverflow: is it
possible to pass a function to a default parameter so that you could do in
essence things like this.
def time_diff(target_time, curr_time= lambda : datetime.now() ):
return
I should add to this (as I cant edit my post) that please note it is not a
constant we are adding. Its a value that will change each time you call the
function. It could be a GUID or rand number too. In this case its the current
time.
___
Python-ideas
I have had a long standing unanswered question on on stackoverflow: is it
possible to pass a function to a default parameter so that you could do in
essence things like this.
def time_diff(target_time, curr_time= lambda : datetime.now() ):
return curr_time - target_time
this would be an
Hi, Thanks for replying.
> One thing that is worth thinking about is the safety of the API that
> is put together. A memory segment plus a separate detached semaphore
> or mutex can be used to build a safe API, but is not itself a safe
> API.
Agreed. That’s why I am more inclined to the second
On Sun, 26 Jul 2020 at 19:11, Vinay Sharma via Python-ideas
wrote:
>
> Problem:
> Currently, let’s say I create a shared_memory segment using
> mulitprocessing.shared_memory.SharedMemory in Process 1 and open the same in
> Process 2.
> Then, I try to write some data to the shared memory segment
11 matches
Mail list logo