Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.
6 votes

Password storage with gatherer plugin in Python

Here's my review of your code: class PasswordStore: add_password(): Consider if you should be validating the arguments: Are ...
J Earls's user avatar
  • 161
5 votes

Class for validating code in different Conda environments with PyTorch

version hardcodes To dry up run_test_old_and_new_code(), it looks like we want a helper that accepts a version number such as ...
J_H's user avatar
  • 40.8k
4 votes

Password storage with gatherer plugin in Python

A few suggestions: def __iter__(self): for title, passwords in self._store.items(): yield title, passwords This can be simplified to: ...
Chris's user avatar
  • 2,774
3 votes

Password storage with gatherer plugin in Python

This method is problematic: def __iter__(self): for title, passwords in self._store.items(): yield title, passwords First, unlike other methods, it ...
InSync's user avatar
  • 369
3 votes

Password storage with gatherer plugin in Python

Logging Minor point: Instead of: logger.debug("Failure extracting password from content") print(traceback.format_exc()) You can do this to include the ...
Kate's user avatar
  • 7,958
3 votes

Compare two directories, apply the changes, backup and restore

This question is 10 years old. I'll attempt to review it, but a lot has happened since. For example, where in 2015 it was (strongly) discouraged to stick to Python 2 any new project starting today ...
Mast's user avatar
  • 13.8k
3 votes

backward induction algorithm computation

Your typehints are incorrect: current_reward etc. are np.ndarray (the actual runtime type), not ...
Reinderien's user avatar
  • 70.5k
3 votes

Integer field in Python with extra constraints (Testable class)

negated identifier def is_not_factor( ... ): Reasonable people will differ on this point, and that's fine. But I'd prefer to call into a Public API with the name <...
J_H's user avatar
  • 40.8k
2 votes

Password storage with gatherer plugin in Python

In addition to the excellent points in the previous answer, here are some other considerations. In the PasswordStore class, the ...
toolic's user avatar
  • 13.6k
2 votes

One-handed Solitaire Game Choice Generator

Overview The code in the classes is easy to follow because of the partitioning, the meaningful names and the docstrings. Here are some style suggestions. UX When I run the code, I see output like ...
toolic's user avatar
  • 13.6k
2 votes

Integer field in Python with extra constraints (Testable class)

Truthiness if (self.minimum and self.maximum): If the caller sets the minimum to 0, as in they want ...
AJNeufeld's user avatar
  • 35k
2 votes

Extract text from scanned documents (JPG), output PDF version, classify documents based on text contents and rename PDF accordingly, then output CSV

/ slashes and \ slashes This raw string is perfect: pytesseract.pytesseract.tesseract_cmd = r"C:\Users\Anthony..." Prefer that over a double ...
J_H's user avatar
  • 40.8k
2 votes

Downloading and transcoding music from YouTube

Simpler There are a number of areas where the code can be simplified. This if/elif: ...
toolic's user avatar
  • 13.6k
2 votes

AVL Tree with delete method in Python 3

Documentation It is great that you use docstrings everywhere. The docstring for the _pre_order function in the Node class says ...
toolic's user avatar
  • 13.6k
2 votes

Integer field in Python with extra constraints (Testable class)

Am I missing something in my class? I'd say the most important thing missing here is a set of unit tests. Including good tests will help your readers understand expected behaviour better than prose ...
Toby Speight's user avatar
  • 86.3k
2 votes

Class for validating code in different Conda environments with PyTorch

The previous answer was thorough, but here are some additional suggestions. DRY Your LOGGER info and ...
toolic's user avatar
  • 13.6k
2 votes

Calculating frequencies of each obs in the data

One of my main concerns is how to limit the amount of opening and closing of files 59 columns by 4400 rows by either 4 (single) or 8 (double) bytes is anywhere from ~1-2 MB. (This is a wild guess ...
Reinderien's user avatar
  • 70.5k
1 vote

Extract text from scanned documents (JPG), output PDF version, classify documents based on text contents and rename PDF accordingly, then output CSV

Partitioning Consider moving the following if/else into a function: ...
toolic's user avatar
  • 13.6k

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