A file prints a banner whenever it is imported. What should happen?
- Keep it, banners are harmless
- Move the banner behind the run only guard
- Delete all functions
What may other code rely on in a module?
- Only the published names it offers
- The private helper drafts
- Every line inside the file
If callers stay on the published surface, the author can rewrite the inside freely.
Circle one: True False
A module reorganizes its internals but keeps published names. Which caller breaks?
- One reaching past the surface into internals
- One that never imports it
- One using only published names
Which import style keeps the module home visible at each use?
- Copying the class into your file
- from shapes import Circle
- import shapes, then shapes.Circle
Two designs differ: one uses shapes.Circle, one digs into helper drafts. Which makes a rename cheaper?
- The digger, since it knows more
- The shapes.Circle one, since it rests on the promise
- Both cost the same
A review finds a caller patching a module private counter to add a feature. What should the review say?
- Ask for a published hook instead, since the patch couples to insides
- Forbid all future imports
- Praise the shortcut
State the promise of a module that mails reports, without describing its inside.
- It loops rows with an index counter
- It opens a socket on port 25
- It sends each report once and reports success or failure