So yesterday I tried to use repr and str in my code for printing objects from list. Here just small example code where I run to same problem.
class Something:
def __init__(self):
pass
def __repr__(self):
return "I want this out"
def __str__(self):
return "this comes out"
def main():
k = Something()
k
print(k)
main()
What is printed:
this comes out
Process finished with exit code 0
Why can't i get the repr out of my object even though I have given it line to return when object is called?