Tom RitchfordBenchmarking shows the loop comprehension is about 10% faster for large lists: try it yourself.It isn't always the case that loop comprehensions are faster, but in this case when you know the size of the input and there is no if…1d ago11d ago1
Tom RitchfordA few more events like this, and I might start believing in justice and rationality again.4d ago4d ago
Tom RitchfordLet's look at that specific function: what would be gained by prohibiting tuple as an input?Why force someone who already has a tuple to create a new list, simply to pass it into a function that would work perfectly well if given…5d ago5d ago
Tom RitchfordI clapped but many packages still have to support Python 3.8,Python 3.8 won't hit end-of-life until October of this year and likely many facilities will be slow to upgrade even then.Jun 24Jun 24
Tom RitchfordBut I would reject this pull request, because your type hints are all wrong.Why must num_list be a list? Why couldn't it be a tuple or some other sequence of numbers? Use typing.Sequence instead.Jun 242Jun 242
Tom RitchfordWell, I got all this from your first answer, but you do again seem to avoid the point that it costs…Let's look at your first example of the junior programmer who was stuck for days and then got unstuck. Why exactly could that scenario not…Jun 241Jun 241
Tom RitchfordThanks for a thoughtful answer. But the problem is not symmetrical!Of course "no one way is right", but you're talking about a company wanting me to come into the office because a subset of developers can't…Jun 211Jun 211
Tom RitchfordI will never go into an office again - at least partly because we're moving to a small French city…But also because I am simply far more productive at home. I don't have to commute, it's really quiet, I can eat good, fresh food, and if I…Jun 21Jun 21
Tom RitchfordFirst, any good linter will detect this issue and complain about it.Second, that is probably the wrong type definition for the function.Jun 21Jun 21
Tom RitchfordIn a long and successful career, I have never once put "OOP" on my résumé.C++ is not an object-oriented language - it's a multi-paradigm language. You can write object-oriented code, but you can also write…Jun 18Jun 18