1
281
submitted 17 hours ago by sirico@feddit.uk to c/programmerhumor@lemmy.ml
2
407
3
375
4
294
submitted 2 days ago* (last edited 2 days 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.

5
1283
6
508
7
460
8
497
I am a sinner (sh.itjust.works)
9
526
10
840
11
936
Certified in AI (sh.itjust.works)
12
781
13
498
14
205
15
170
16
171
Let's do micro service (sh.itjust.works)
17
189
js Monk and Fly (sh.itjust.works)
18
447
got him (lemy.lol)
submitted 1 week ago by ngn@lemy.lol to c/programmerhumor@lemmy.ml
19
295
20
218
submitted 6 days ago* (last edited 6 days ago) by Kristofers_Solo@lemmy.ml to c/programmerhumor@lemmy.ml
21
288
22
1089
Users (lemmy.world)
23
35
24
115
Best constant in all of iOS! (developer.apple.com)

Part of the contact management framework. The label for the contact’s mother’s sibling’s younger son or father’s sister’s younger son.

25
287
Interview tips (lemmy.ml)
view more: next ›

Programmer Humor

30778 readers
809 users here now

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

Rules:

founded 4 years ago
MODERATORS