sjmielke:

it seems like it literally compares the two signed integers (current class and ignored_index) in C, so any negative number should just never match.


I’m a bit late, but I don’t fully understand this claim. Why would two signed integers never match for negative values?



 Sam-gege:

I’m too wondering why it is set to this particular value rather than a simple None


I guess the default value might have been a convenient “invalid” long to use without overloading the argument list to long, and a None object etc.
My guess is that it’s thus just for legacy and beckwards compatibility reasons and if this argument would have been added nowadays, better overloading might have been used.