News for hackers. Stuff that matters.
Re:How to build your own neural network from scratch in Python by jononor on Saturday October 06, 2018 @06:47AM (#18154470)
The never use map/filter is in favor of list comprehensions, which is not really a OOP construct.

But sure, it's a conventional thing. And for a long time the built-in alternatives to a class for such a datastructure tuples and dicts, neither which are very nice for functions to operate on (dict values have to be addressed with d['key'] instead of d.key). With a class and method there is also no doubt as to what the function operates on, which is convenient when there type hints and IDE support is missing. This is changing since Python 3.5 and type checking tools like MyPy.

Since Python 3.7 there are also data classes, a primitive for classes which just hold values. https://www.linuxjournal.com/content/introducing-python-37s-... But it will take a while before programming conventions change.

There are no comments on this comment yet.