26
525
27
201

cross-posted from: https://lemmy.cringecollective.io/post/9716

Maybe some ALGOL 58 while we're at it too.

28
219
29
386
print('butt') (lemmy.world)
30
235
31
53
32
348
33
398
submitted 2 weeks ago by Maven@lemmy.zip to c/programmerhumor@lemmy.ml
34
426
35
309
submitted 2 weeks ago* (last edited 2 weeks ago) by renzev@lemmy.world to c/programmerhumor@lemmy.ml

Explanation: Python is a programming language. Numpy is a library for python that makes it possible to run large computations much faster than in native python. In order to make that possible, it needs to keep its own set of data types that are different from python's native datatypes, which means you now have two different bool types and two different sets of True and False. Lovely.

Mypy is a type checker for python (python supports static typing, but doesn't actually enforce it). Mypy treats numpy's bool_ and python's native bool as incompatible types, leading to the asinine error message above. Mypy is "technically" correct, since they are two completely different classes. But in practice, there is little functional difference between bool and bool_. So you have to do dumb workarounds like declaring every bool values as bool | np.bool_ or casting bool_ down to bool. Ugh. Both numpy and mypy declared this issue a WONTFIX. Lovely.

36
1326
37
525
38
473
submitted 2 weeks ago by Five@slrpnk.net to c/programmerhumor@lemmy.ml
39
212
40
506
41
536
42
195
js Monk and Fly (sh.itjust.works)
43
853
44
948
Certified in AI (sh.itjust.works)
45
180
Let's do micro service (sh.itjust.works)
46
511
I am a sinner (sh.itjust.works)
47
178
48
787
49
301
50
223
submitted 3 weeks ago* (last edited 3 weeks ago) by Kristofers_Solo@lemmy.ml to c/programmerhumor@lemmy.ml
view more: ‹ prev next ›

Programmer Humor

30940 readers
168 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS