Skip to content

Questions about the simple example in the docs #150

Discussion options

You must be logged in to vote

You are correct regarding ao, there is no need to assign it to a variable at all. It's a stylistic choice to keep the lines looking neater together and to indicate to users that this function does also return an object you can interact with.

The use of the globals() function is important in making a Python interpreter that functions as one would expect. Try removing it and then inspecting ai - you'll find that the interpreter will tell you that it's undefined. By passing the globals() dict in here, users can access all their already defined variables in their IOC.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wigging
Comment options

@AlexanderWells-diamond
Comment options

Answer selected by wigging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants