Posts by Mateus Cardoso Silva • 69 points
6 posts
-
1
votes1
answer584
viewsQ: What can’t be done with f-string that you can do when using . format?
Hello I would like to know in which cases I need to use the format method instead of f-string because with f-string it is not possible to do. For example I think it is not possible with f-string to…
pythonasked Mateus Cardoso Silva 69 -
1
votes1
answer55
viewsQ: Is it valid for two objects to have reciprocal references?
Is this an acceptable practice or is it a gambit and shouldn’t you ever do it? Is there any solution to avoid this? It turns out that the player object needs to know what the state of the game is in…
-
2
votes1
answer192
viewsQ: Problems with __eq__, __lt__, etc. and the method removes from the list object
I’m having the following problem, I have a letter class and use the magic methods eq, ne, le, it’s, ge, gt to be able to compare the value of two cards and also to be able to use the Sort function,…
-
1
votes1
answer99
viewsQ: How to name variables and organize them in the code in what goes beyond PEP 8?
Where I could find tips for naming variables, organizing code, etc.? For example, I have a class and it has several attributes, some depend on whether another attribute has been declared before, but…
-
0
votes1
answer40
viewsQ: How can I do that without needing this global variable?
The problem I have is the following I have a method that should be called 4 times, once every 750 ms. The problem is that the way it is called I can’t pass arguments to it, why it is called via…
-
1
votes1
answer197
viewsQ: Why is such a simple game getting so heavy?
This is the first project I developed using Pygame. Because it’s a simple card game, I hoped it would be very light, but not really. As I am using a very weak computer (single core 1gb ram) it is…