cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake | IRC logs: and | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
jcea has joined #pypy
jinsun is now known as Guest2922
jinsun__ has joined #pypy
Guest2922 has quit [Killed ( (Nickname regained by services))]
jinsun__ is now known as jinsun
jcea has quit [Ping timeout: 248 seconds]
KorSolidarity has quit [Quit: Leaving]
sol_ has joined #pypy
lehmrob has joined #pypy
lehmrob has quit [Ping timeout: 246 seconds]
<mattip> quiz: what error should this produce?
<mattip> python -c 'b"foo\xacbar".decode("utf-8\udce2\udc80\udc9d")'
<mattip> pypy3 emits a UnicodeDecodeError,
<mattip> cpython3 emits a UnicodeEncodeError
<mattip> cpython wants to encode the encoding into ascii
<mattip> s/ascii/utf-8/
lessshaste has joined #pypy
leshaste has quit [Read error: Connection reset by peer]
lehmrob has joined #pypy
Cheery_ is now known as Cheery
lehmrob has quit [Ping timeout: 246 seconds]
Atque has quit [Ping timeout: 255 seconds]
Atque has joined #pypy
<Hodgestar> mattip: I have no idea. :)
<Hodgestar> mattip: I guess the correct answer is "sanitise the encoding string before trying to use it", but I like UnicodeDecodeError a bit more than UnicodeEncodeError (encoding the encoding seems like an implementation detail that breaks the simple mental model of "decoding should raise decoding errors").
sol_ has quit [Read error: Connection reset by peer]
<mattip> yeah, it confused me too until I looked at the implementation of `unicode_decode`
<lessshaste> numpy is so confusing. np.sum(A) is twice as slow as A.sum()
sol__ has joined #pypy
<mattip> what is A.shape, A.dtype ?
<lessshaste> mattip, just tried with a bigger example
<lessshaste> In [11]: A.shape
<lessshaste> Out[11]: (10000,)
<lessshaste> In [12]: A.dtype
<lessshaste> Out[12]: dtype('float64')
Julian has joined #pypy
<mattip> small examples suffer from the overhead of np.asarray(A) inside np.sum
<lessshaste> does 10,000 count as small?
<mattip> basically np.sum(A) is "np.asarray(A).sum() but it has dispatching to allow __array_function__ overrides
<lessshaste> but what is np.asarray(A) doing given that it is already an numpy array?
<mattip> this override code has been moved to C to make it faster in the dev version of numpy
<lessshaste> mattip, well that's interesting!
Julian has quit [Ping timeout: 246 seconds]
Julian has joined #pypy
<lessshaste> mattip, it's all very confusing as, B) is faster than np.sum(A)
<mattip> if you have less than a million elements, I think you are mainly measuring overhead of setting things up
<mattip> and the difference is microseconds
<lessshaste> mattip, the problem is that I do this millions of times . What setup is add.reduce(A) or A.sum() doing that is not?
<lessshaste> mattip, you are right though. If I set the arrays to length a million than is very slightly slower
lritter has joined #pypy
Atque is now known as Not_Atque
Not_Atque is now known as Atque
Julian has quit [Quit: leaving]
<mattip> dot is special. It is different from matmul, and broadcasts over the last 2 dimensions for ndarrays with D>2
<mattip> so it does not allow __array_ufunc__ overloading
Dejan has quit [Quit: Leaving]
derpydoo has joined #pypy
jcea has joined #pypy
sol__ has quit [Quit: Leaving]
derpydoo has quit [Quit: derpydoo]
derpydoo has joined #pypy
leshaste has joined #pypy
lessshaste has quit [Remote host closed the connection]
leshaste has quit [Read error: Connection reset by peer]
leshaste has joined #pypy
derpydoo has quit [Quit: derpydoo]
jcea has quit [Quit: jcea]
lritter has quit [Ping timeout: 248 seconds]
jcea has joined #pypy
vext01 has quit [Quit: WeeChat 3.6]