News for hackers. Stuff that matters.
Re:Understanding Python through its builtins by tored on Sunday October 10, 2021 @05:43PM (#28822252)
As a non-Python dev I tried the other day to read up how decorators work in Python using the docs, can’t say it helped.
Re:Understanding Python through its builtins by pansa2 on Sunday October 10, 2021 @07:44PM (#28823000)
Decorators are very simple. I'm not surprised that there's not much documentation about them - there's just not much to say.

    @decorator
    def f(...): ...
is equivalent to:

    def f(...): ...
    f = decorator(f)
That's it.
Re:Understanding Python through its builtins by burnished on Monday October 11, 2021 @03:39PM (#28832122)
If you read the docs then you basically would not know about them. My experience mirrors the people upthread. I also found that the Python community is very hostile to the idea that the docs might be insufficient, in that people suggesting this in threads were frequently belittled or it was often suggested that the questant should just learn it like they did, or that it wasn't really all that hard.
Re:Understanding Python through its builtins by dehrmann on Monday October 11, 2021 @10:41PM (#28835504)
I've looked at a lot of Javadocs and Python docs. Python's docs leave a lot more up to the imagination and are generally harder to navigate around.

Compare their ThreadPoolExecutors (Python's being inspired by Java's)

https://docs.python.org/3/library/concurrent.futures.html#co...

https://docs.oracle.com/javase/7/docs/api/java/util/concurre...