Tagged Questions
0
votes
2answers
47 views
Extending a simple Python console program with external code. Did I handle this correctly?
I'm a hobbyist Python programmer with not much experience.
I wrote some code for a solution to a Tic Tac Toe AI problem on the internet.
Then yesterday I wrote a simple console Tic Tac Toe game for ...
1
vote
1answer
75 views
Should I use a class as a class factory in Python?
As a bit of a learning project, I decided to take the concept of proxying objects a bit further and extend it to creating proxy classes which create proxy'd objects. I originally found the idea of ...
2
votes
3answers
109 views
Python: How much logic is enough logic, and how much is too much logic in an __init__ method?
I am writing an email parser and cannot decide how much logic should be included in the __init__ function. I know, a constructor should make the object ready for use, but are there best practices to ...
1
vote
2answers
101 views
Is this class structure good?
I'm writing a pong game in Python and I created classes for the game objects.
The top level class is Object, and Ball and Paddle inherit from it. And ComputerPaddle is a child class of Paddle.
# ...
3
votes
2answers
88 views
improve the design of class “accuracy” in Python
I am learning about the class and methods in Python.
The class Accuracy is a class of several (13 in total) statistic values between a reference polygon and one or more segmented polygons based on ...
2
votes
2answers
119 views
Python class review - wiki api getter
First, I know there are other Python wiki API classes out there. I'm writing this one because I don't need all the bells and whistles, no edits, no talks, etc. I just need to be able to search for ...
1
vote
2answers
130 views
Python: keeping track of info across classes by storing a variable to self
I wrote the following code to test a score-keeping class. The idea was to keep score of a game such that the score was kept across multiple classes and methods.
I'm looking for any input on being ...
3
votes
2answers
119 views
Style comments please on my timer class, which I hope will be a pattern for other classes
I'm a relative noob to Python. On a range of 0 to 10, where 0 is a complete noob and 9 is Guido, I'd put myself as 1 aspiring to 2.
So I wanted a timer, rather like the Visual Basic object, and I ...
2
votes
1answer
135 views
What could be improved in this implementation of a Vector3D class?
[EDIT #1: Read more of the meta, editing to remove the impression I might be looking for "micro benchmarking code golf", I really just want general feedback and thought an experienced coder might see ...
4
votes
1answer
236 views
Python, WeakBoundMethod
I've written this small class in Pyhon that wraps bound methods but does not prevent the deletion of self. Do you have any though on my code? Do you think I handle errors appropriately? Is it missing ...