May-25-2023, 02:08 PM
(May-25-2023, 01:29 PM)deanhystad Wrote: It is best if you can write a working example that displays the problem you are trying to solve. I know I get confused about a question that has code that looks like Python but clearly is not Python. You are trying to ask a question in a language you don't understand, and the language barrier is a more difficult puzzle than the question.
I have a class that makes an object. I want to get that object from outside the class
class A: def __init__(self): self.thing = Thing() a = A() # outside_thing = ?If you cannot write a snippet like that, it is probably better to just go with text.
I have a class (call it "A") that makes an object (call it "thing"). I want to access the "thing" from outside an instance of the class
If you don't know enough to ask a question like that, take it as an indication that you need to spend some time learning about classes and objects. Ask a question like this:
I am just getting started learning to write my own Python classes. Can you recommend a good resource?
After study you will know what classes, instances and attributes are, and know enough of language that there won't be a language barrier in asking your question. Of course, after some study you'll probably know the answer to your question.
As you well know, the practical application of concepts learned in a book is something that takes some time and practice. Imagine that someone (insert my name here) has done so and still struggles with those concepts so he asks questions that are born of that inexperience and lack of understanding. Now imagine answering a question from such a person with "Go learn the language". It's a little frustrating.