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

All Questions

Filter by
Sorted by
Tagged with
-2 votes
1 answer
91 views

Initializing an object using a staticmethod

I've an object that looks like this, and users have been populating the attributes post-initialization, e.g. ...
alvas's user avatar
  • 709
6 votes
2 answers
713 views

What is the best way to set a class value to a variable in Python if it exists in a dictionary?

I have this code which sets values in a location class from values from JSON data. ...
Asher Ross's user avatar
5 votes
1 answer
190 views

Arabic language lesson program Part 2

This is the second time I am asking for a review of this code (first time can be found here: Arabic language lesson program). The goal of the program hasn't changed - to house Arabic language lessons ...
Jack Duane's user avatar
12 votes
1 answer
564 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
Alex's user avatar
  • 223
3 votes
2 answers
119 views

V2. Interactive dictionary with inexact look ups (updated)

Recently I published a post in which three people made pretty good suggestions. I've learnt a lot since then thanks to them! From among many things, they encouraged me to use classes. And that's ...
user avatar
2 votes
0 answers
83 views

API client for a package shipping system

I would like to implement a higher level design pattern here but I am a bit stumped, How can I improve this code and make it more object oriented? ...
DIzzyDiza's user avatar
2 votes
2 answers
268 views

TranslateIt class using the Yandex translation service

I wrote a class TranslateIt for translating text files with Yandex.Translate service. I feel the code is rather bulky. Is it ...
Mikhail Belousov's user avatar
2 votes
2 answers
2k views

Program to edit an address book stored as a JSON file

I'm trying my hand at an address book and the goal is for it to have a bit more of error prevention. For instance, for the key "phone" to have 10 digits, and not allow alpha characters at section 4. I ...
refinneJ's user avatar
1 vote
1 answer
9k views

Filters for a JSON collection

I am trying to create a class that parses a JSON and selects all labels, or just a particular label that you prefer to later do a calculation with the value pair extracted off that label. This is ...
xavier's user avatar
  • 145