News for hackers. Stuff that matters.
Re:Minimal examples of data structures and algorithms in Python by a3n on Monday April 24, 2017 @08:49PM (#14189876)
Suggestion: a short main() and if __name__ = ... for each file, serving as a demo/smoke test. It doesn't stop you from importing it as a module, and it's nice to see using code.
Re:Minimal examples of data structures and algorithms in Python by felixhummel on Tuesday April 25, 2017 @06:30AM (#14192225)
Along the same lines - use doctests maybe?

    if __name__ == "__main__":
        import doctest
        doctest.testmod()
https://docs.python.org/3.5/library/doctest.html
Re:Minimal examples of data structures and algorithms in Python by a3n on Tuesday April 25, 2017 @01:02PM (#14195606)
A great idea. But I'd also like to see an all-in-one-place dog and pony show, constructing it and using it right next to each other.
Re:Minimal examples of data structures and algorithms in Python by majke on Tuesday April 25, 2017 @06:55AM (#14192347)
Agreed. Such code without decent doctests is close to useless. Also - try to get decent code coverage if you can.