Re: an adventure: a Lisp-style linked list

2025-09-10 Thread Pierre Asselin
Ethan Carter wrote: > def __init__(self, d, ls): > self.head = d > self.tail = ls Why not def __init__(self, d, ls=None): and avoid the need for a List.Empty ? -- pa at panix dot com -- https://mail.python.org/mailman3//lists/python-list.python.org

staticmethod(cls)

2025-09-10 Thread Pierre Asselin
For reasons I won't go into I ended up defining classes inside of a class body. That's not in the manual, but I see no reason it would fail. But then, I accidentally decorated the inner classes with @staticmethod! It didn't break anything, but it had an interesting side effect: help() and pydoc on

__doc__+= """Detailed description"""

2012-05-09 Thread Pierre Asselin
Hi. Started using python a few months back, still settling on my style. I write docstrings and I use "pydoc mymodule" to refresh my memory. Problem: if I just docstring my classes/methods/functions the output of pydoc more or less works as a reference manual, but if I get sidetracked for even a