Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Draft saved
Draft discarded
Cancel
4
  • You can call it only from inside the method Commented Apr 2, 2020 at 8:20
  • 1
    The class is redefined every time you call the function. You can't easily access the class from outside the function. Commented Apr 2, 2020 at 8:21
  • You can’t "call" a class. in the code you’ve shown you’re defining a class, and when you create objects from it you are instantiating it. Commented Apr 2, 2020 at 8:22
  • The same way you use any object created inside a function, you return it from the function and it is up to the caller to use the object. Commented Apr 2, 2020 at 8:22

lang-py

AltStyle によって変換されたページ (->オリジナル) /