3 ms·
Part of the issue is the name, which is generic enough that with the generic implementation, it probably also wants a maximally generic type. A more constraine
by dllthomas 10y ago
Part of the issue is the name, which is generic enough that with the generic implementation, it probably also wants a maximally generic type.
A more constrained type throws away "the advantages of Python's duck-typing", but it also throws away disadvantages, and that can be precisely what you want.
- clusmore 10y agoYes, this is a good point too which I certainly agree with. Sometimes by using the most general type, you actually permit more than you intended and you might restrict yourself from making refactorings to the function because it would restrict the types.