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 ...
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 ...
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:
...
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 ...
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 ...
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♦
- 13.8k
3
votes
backward induction algorithm computation
Your typehints are incorrect: current_reward etc. are np.ndarray (the actual runtime type), not ...
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 <...
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 ...
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 ...
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 ...
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 ...
2
votes
Downloading and transcoding music from YouTube
Simpler
There are a number of areas where the code can be simplified.
This if/elif:
...
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 ...
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 ...
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 ...
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 ...
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:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
python × 15564python-3.x × 5183
performance × 2366
beginner × 2002
python-2.x × 1233
algorithm × 1206
programming-challenge × 1039
numpy × 752
object-oriented × 726
pandas × 598
game × 543
strings × 489
web-scraping × 429
time-limit-exceeded × 396
tkinter × 351
parsing × 322
django × 306
csv × 304
hash-map × 295
random × 253
pygame × 246
recursion × 245
file-system × 236
regex × 234
reinventing-the-wheel × 225