So far, my journey to the fascinating world of Python's going fine. It feels that the language can allow you to do lots of things, even shooting yourself in the leg, if you know how to make Python do so. Every object seems to have "hidden" properties that return an error unless you've done something to them to make them work the way you want them to. One good example'd be class method "abstractmethods" - it is in object's dir, but returns an error upon calling help on that. However, this thing can be modified and used the way you want it to. In the context of the course, this is not the most important thing, though.
Recursion, apparently, opens a whole new field in Python. Looks exploitable, however, caution should be used when running some recursion-containing function. Otherwise, you're very likely to run into an infinite loop. Fortunately, this won't be too bad - most CPU's have multiple cores, Pythin uses only 1, so the freeze won't be awful. Moreover, Python seems to have a built-in loop detector, which quits a program if a loop's been run over 300 times.
Messing with attributes of classes and making them inaccessible for your typical user also seems to be a powerful tool, especially for managing objects that are not supposed to be modified. It might be difficult to appreciate usefulness of these small things until you run into a situation where you absolutely have to make use of them. What is knowing a programming language if not knowing small useful things about it?
Looking forward to the upcoming lecture on sorting mechanisms - I'd like to use a faster algorithm in one of the scripts I wrote to make my life easier, as the default, built-in sorting algorithm in Python is extremely slow.
Recursion, apparently, opens a whole new field in Python. Looks exploitable, however, caution should be used when running some recursion-containing function. Otherwise, you're very likely to run into an infinite loop. Fortunately, this won't be too bad - most CPU's have multiple cores, Pythin uses only 1, so the freeze won't be awful. Moreover, Python seems to have a built-in loop detector, which quits a program if a loop's been run over 300 times.
Messing with attributes of classes and making them inaccessible for your typical user also seems to be a powerful tool, especially for managing objects that are not supposed to be modified. It might be difficult to appreciate usefulness of these small things until you run into a situation where you absolutely have to make use of them. What is knowing a programming language if not knowing small useful things about it?
Looking forward to the upcoming lecture on sorting mechanisms - I'd like to use a faster algorithm in one of the scripts I wrote to make my life easier, as the default, built-in sorting algorithm in Python is extremely slow.
Комментариев нет:
Отправить комментарий