Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Docstrings

📅 2009-Oct-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ comments, docstrings, python ⬩ 📚 Archive

def foobar():
    """Calculate the speed of thought."""
    return
    
    class Light:
        """Light and its attributes."""
        def __init__(self):
            return
    
print(foobar.__doc__)   # Calculate the speed of thought.
print(Light.__doc__)    # Light and its attributes.

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email