I have the following valid Python code: class A: def __init__(self): """ Some doc-string """ def some_method(self): """ Some other doc-string """ def say(): """ Well that's it, no doc-string """ a = A() print('works') And it outputs works. But I'm not able to understand how is this a perfectly valid Python code. Can somebody please help me to understand its functioning? Also, are there any PEPs which discourage/disallow such code? Continue reading...