82 points · by thewhitetulip · 9y ago · 33 comments
https://github.com/thewhitetulip/build-app-with-python-antit...
> Python has been around for more than 30 years
The license says that development began in the early 90s.
The factual errors continue in the explanation of the language, such as describing a triple quote string as a multiline comment.
I might have misstated. The idea was around more than 30yrs albeit the implementation has been for around 27yrs
> triple quote string as a multiline comment.
Don't you use triple quoted string as a multi line comment? Then what do you use for multi line comment? I am curious.
def demo():
"""I'm a demo. Maybe a few lines of
doctests below.
"""
return 42
You can now, for example in ipython do: help(demo) and get the demo.__doc__ back. See also doctests.So no, they are not comments - they are part of the code -- but they are often used to comment on, and document the code.
docstrings pep: https://www.python.org/dev/peps/pep-0257/
docstring definition from the python docs: https://docs.python.org/3.5/glossary.html#term-docstring
doctest: https://docs.python.org/3.5/library/doctest.html?highlight=d...
You might be familiar with the concept in Javascript, if you have ever put 'use strict' at the top of a JS file.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
The guy's handle is thewhitetulip, which is the most Dutch thing I can think of.[0]: https://twitter.com/gvanrossum/status/112670605505077248
Thank you!
You also claimed that Python 3 was written to fix 30-year-old mistakes. Python 3 has been around of a while now.
Thank you!