Can you explain the concept stubbing out functions or classes
taken from this article?
class Loaf:
pass
This class doesn't define any methods or attributes, but syntactically, there needs to be something in the definition, so you use pass. This is a Python reserved word that just means “move along, nothing to see here”. It's a statement that does nothing, and it's a good placeholder when you're stubbing out functions or classes.`
thank you
Ellipsis ...
is preferable to pass
for stubbing.
pass
means "do nothing", whereas ...
means "something should go here" - it's a placeholder for future code. The effect is the same but the meaning is different.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With