4 ms·
> So if I do `sorted_list = my_list.sort()`, my `sorted_list` will be `none` This is (one of) my biggest gripes with Python. It's utterly inconsistent with its
by cguess 2y ago
> So if I do `sorted_list = my_list.sort()`, my `sorted_list` will be `none`
This is (one of) my biggest gripes with Python. It's utterly inconsistent with its design, and library designers have taken that to mean they also can do anything they want, leaving NumPy vs Pandas to have completely different class vs object stylings for instance. I reach for Python these days only when there's no other option because I'm 100% sure I'll spend 50% more time in the debugger than using Ruby for a similar problem.
- pepoluan 2y agoThis is why you should use type hints and some kind of type checking. sorted_list: list = my_list.sort() will raise a red flag with a type checker.