PEP (Python Enhancement Proposal) are describing new features, processes or other guidelines and information.
They are written primarily for core CPython or other implementation developers.
But actually, they are fun and interesting read for a regular developer as well. It is because the authors are really polishing
the documents (standards are rigorous) and in addition to documentation, we can get to know proposed or already implemented features.
Anyway, fun to read. One disadvantage, PEPs are sometimes long.
Coming from for Java world we could ask what the best way for method overloading in Python language is. There are many ways to achieve that; some are even considered an anti-patterns. Let’s through a few of them and choose the best.
Task: Define the function that takes two parameters (dictionaries as default). Without modifying original dictionaries return the new one that includes all key and value pairs
however, if key repeats itself, then add values
a = {'a': 5, 'b': 1, 'c': -1, 'd': 1}
b = {'a': 1, 'b': 5, 'c': 1, 'e': 1}
solution = {'a': 6, 'b': 6, 'c': 0, 'd': 1, 'e': 1}
Task: merge and sort two ordered lists
list_a = [8, 10, 12, 44, 63, 66]
list_b = [2, 3, 20, 106, 144]
solution = [2, 3, 8, 10, 12, 20, 44, 63, 66, 106, 144]
In my spare time, I am creating small Django web application, designed for language schools administration. This month I decided to deploy it to the server finally. Quick research gave me a few possibilities: home setup with raspberry pi (kind of free), pythonanywhere.com (free/paid), heroku.com (free/paid), digitalocean.com (paid), linode.com (paid). I have chosen DigitalOcean, and here are is why.
Santa Claus Rally is a seasonal increase of stock value in financial markets that usually occurs in last weeks of December. It is caused by, as always too optimistic, feelings of traders. This year expected rally did not start very positively (special greetings for crypto holders), and I can almost hear cries of many people.. ;)
Well, at least in software development things are not changing in such a drastic way. A good example of this is the Django web framework. Because Django is mature and stable, even having an increased release cycle (currently feature release is every eight months and LTS every two years), things are progressing rather slowly.
This morning for the interviewed person we had a short algorithmic task. Given n = 5, create a list of multiplied integers:
[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]
My little tour on Python Web Shops is over for now. It has been an excellent chance to see what is going on in the town. I have been applying mainly for a web developer position. Below is a list of few interview questions I have got. I will answer the most interesting or ones that require more in-depth research in the next articles.
As software developers, we have a very comfortable life because usually, the recruiters are calling to us, and not otherwise.
Not always the talks are intelligent and sometimes are just a waste of time. Usually, it is not the fault of recruiters, because it is easy to get lost in the myriads of technology buzzwords and misinterpret them. Occasionally they are just not experienced enough to distinguish junior from a senior candidate.
Sometimes, however, the developers need to put more work in having a well presented professional side of our personality, and worse, update it often. Apparently, this is not our strongest side, an excellent solution would be to put ourselves in the hands of the professional agency. Some still will choose the harder way, well…
I did “Learn Python the Hard Way”
Python 3.5 brought us 4-100 times faster OrderedDict thanks to its implementation in C, before was written in Python. Python 3.6 improved a standard library dictionary, by making it use more compact representation. Now dictionary could use 20% to 25% less memory compared to Python 3.5, and the order of items was kept but as suggested it was only an implementation detail and should not be used officially (backwards compatibility). Well, in Python 3.7 it has been approved.
Which one should we use now? Standard dict or OrderedDict ?