Hot answers tagged

5 votes
Accepted

Matching dependency versions across multiple Python projects

60 repos containing Python packages I have a few years' experience working with about double that. Different repos had different policies. Many of them would rev independently. Keeping a repo small ...
J_H's user avatar
  • 2,912
3 votes

Best practices for unit testing when breaking down functions into smaller ones

I'm sure someone will provide you with a more detailed answer, but here are some things to consider: Unit tests are used to verify that the behavior of a function is correct and to prevent regressions ...
sfiss's user avatar
  • 725
2 votes
Accepted

Best practices for unit testing when breaking down functions into smaller ones

Don't try make such decisions up-front - it is way easier to decide when growing your unit tests alongside with the development of your functions. You wrote let us act like each line is a long ...
Doc Brown's user avatar
  • 201k
2 votes

Best design practice when one python method passes most of its arguments to another method

Is there a recommended programming style here to prevent the definition of m1 from getting too verbose? Sort of. The style is called "working in small iterations, doing regular refactorings, ...
Doc Brown's user avatar
  • 201k
1 vote

Best design practice when one python method passes most of its arguments to another method

Create a data object with those grouped parameters. And then pass the data object between functions.
Adam B's user avatar
  • 1,525
1 vote

Leetcode: 2327. Number of People Aware of a Secret and Problem with programming skill in general

I'm trying to provide an intuitive answer to your intuitive question here, because you're not asking how to solve the problem but rather why recursion is not the favored way of doing so. Let's explore ...
Flater's user avatar
  • 45.5k
1 vote

Leetcode: 2327. Number of People Aware of a Secret and Problem with programming skill in general

There are a number of skills/techniques/experiance that will help with Leetcode style problems, specifically: Being able to switch between imperative and functional (recursive) forms - sometimes one ...
DavidT's user avatar
  • 1,214
1 vote

Leetcode: 2327. Number of People Aware of a Secret and Problem with programming skill in general

It sounds like you're not happy with the solutions you're coming up with. Even when they work they aren't fast enough to make you happy. Keep demanding perfection and you're sure to maintain your ...
candied_orange's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible