Ad
  • Custom User Avatar

    are you an arabic my friend

  • Custom User Avatar

    OP solved it, closing

  • Default User Avatar

    It is a waste of time in the sense that you are at best trying to rely on undefined behaviour, but I don't think the version is the difference at all, but rather that you are running the test differently.

    0.0 is 0.0 typically evaluates to True, but if you obtain 0.0 from two different modules those may be separate values.

    Testing whether you receive THE SAME ONE 0.0 is a very very strange thing and probably isn't even what you mean to do.

    What you're supposed to test is whether both are 0.0, not whether they're the same 0.0

    0 happens to be different only because cpython keeps a single instance of it. you still shouldn't make that comparison though.

  • Custom User Avatar
  • Default User Avatar

    This does not pass all tests with 3.8, maybe you mean some tests but some is not all.
    In particular, python does not promise that there exists only one 0 and one 0.0. For cpython this is true for 0 (though the language does not promise it, so you shouldn't) but is not true for 0.0 so you both shouldn't and can't.

  • Default User Avatar

    Your warning message provides a reference that you can google to answer your own question.