<mattip>
that is a bit harsh. Maybe the issue should be raised with tox
<mattip>
ahh, this is just a few tests that mock the time module. Maybe tox could install time-machine for testing only on CPython, and skip tests that require it
<Alex_Gaynor>
Does tox4 still support pypy3 test envs?
<mgorny>
yes
<Alex_Gaynor>
👍
jinsun__ has joined #pypy
jinsun is now known as Guest9413
Guest9413 has quit [Killed (cadmium.libera.chat (Nickname regained by services))]
jinsun__ is now known as jinsun
anonwastaken has joined #pypy
<anonwastaken>
Hi, I have issues with pypy, I was meme on 4chan with math equation so I wrote simple code to solve it, code:
<anonwastaken>
import math
<anonwastaken>
for i in range(2, 7): sumarize += math.pow(8/3+13/2-25/6, math.sqrt(4))-math.pow(2, i)
<anonwastaken>
sumarize = 0
<anonwastaken>
print(sumarize)
<anonwastaken>
pypy returns -44 and python 1 (0.999999...), the correct solution is 1
anonwastaken has quit [Quit: leaving]
anonwastaken has joined #pypy
lritter has quit [Ping timeout: 252 seconds]
<anonwastaken>
I found bug with math in pypy, code: https://termbin.com/2td77 pypy prints -44 and python prints 1 (0.999...), the correct answer is 1, also want to say that you are doing amazing job
anonwastaken has quit [Quit: Reconnecting]
anonwastaken has joined #pypy
anonwastaken has quit [Client Quit]
<cfbolz>
anonwastaken: you are comparing CPython3 with PyPy2
<cfbolz>
pypy2 and cpython2 both give -44; pypy3 and cpython3 both give 0.999...
<cfbolz>
this is due to the change in behavior of the / operator, which went from being floor division on ints, to true division = giving float results
eamanu has quit []
eamanu has joined #pypy
<jinsun>
hello, I see weird import problems in pypy, seems like I can't import any extension modules from inside a venv
<jinsun>
for example import sqlite3 tries to load _sqlite3_cffi and then failes with ImportError: The specified module could not be found, but there is a _sqlite3_cffi.pypy39-pp73-win_amd64.pyd in sys.path and that is loaded when I use the "system" interpreter instead of the venv
otisolsen70 has quit [Quit: Leaving]
<jinsun>
hmm, and it actually works fine with the binary downloaded from pypy.org, I was trying using the conda-forge pypy 3.9 before
<mattip>
jinsun: could you record your steps in a new issue in the issue tracker?
<jinsun>
mattip: is this okay? https://bpa.st/PHSA, you might also need windows to reproduce
<jinsun>
hmm it may also be some stupid thing with conda, let me see if I can make a new conda env and then reproduce
<mattip>
maybe something like not being able to load sqlite.dll which _sqlite3_cffi needs?
<jinsun>
mattip: okay new conda environment didn't change anything, new paste with the conda/mamba steps also, https://bpa.st/BWFA
<jinsun>
there is sqlite3.dll inside pypy39/Library/bin, not inside pypy39/Lib where _sqlite3_cffi is, but it loads fine if I don't use venv, so not sure if that really matters
<mattip>
yup, it mattters. Try os.add_dll_directory('path/to/pypy39/Library/bin') before "import sqlite3" and now it doesn't fail
<mattip>
in the venv
<jinsun>
mattip: ah yes it works after that
<jinsun>
in the pypy.org download, the dll is inside /Lib instead of /Library/bin so that is why it works there I guess
<mattip>
cython has a whole startup thing to make this work