Podcast
Questions and Answers
What happens to the namespace when someone does an import from common.validators import star?
What happens to the namespace when someone does an import from common.validators import star?
- The namespace only imports the boolean and date modules.
- The namespace imports only the Json and numeric modules.
- The namespace remains clean with only the necessary validator methods.
- The namespace becomes polluted with all the symbols from the Validator's namespace. (correct)
Why is the dunder all method used in the validators module code?
Why is the dunder all method used in the validators module code?
- To remove all the helper methods from the namespace.
- To concatenate lists of properties from different modules.
- To selectively export certain symbols from the namespace. (correct)
- To import all the modules from the Validator's namespace.
What is the problem with having numeric and is_numeric in the namespace?
What is the problem with having numeric and is_numeric in the namespace?
- They are redundant and unnecessary. (correct)
- They are not compatible with the boolean module.
- They are not imported by default.
- They are not part of the Validator's namespace.
What is the advantage of setting dunder all in each individual module?
What is the advantage of setting dunder all in each individual module?
Why is it a bad practice to do an import star from the common.validators module?
Why is it a bad practice to do an import star from the common.validators module?