Pivot number one – Python 2.7 to 3.5

Pivot number one – Python 2.7 to 3.5

Why did we migrated from Python 2.7 to Python 3.5?

After many discussions and long conversations Alexis and I decided that we should use Python 3. I can’t really point on the exact reason that made us agreed on this change, but I guess the parse_ip bug (As described over here) was the real catalysis. We’ve spent so much time fixing something that worked just fine in python 3. We just snapped, and decided to bite our lips and make the change.

So how will your code base be effected?

Not much actually. We’ve tried our best to keep the changes in the code as minimal as possible. But nevertheless, there’re changes. We’ll add a sub section to each individual post that was published prior to the Python 3.5 migration. In these sub sections we’ll do our best to cover all of the changes in the code. We’re also highly suggesting that you’ll view the full change log in github.

  • Pay attention! The github change log displays all of the changes in the code, included many changes that are nothing more than a draft and changes that aren’t necessarily related to Python 3 migration.


Here’s a list of most of the changes that were made in the code during this Python 3.5 migration:

  1. Every print function is now requires parentheses print "hello world" --> print ("hello world").
  2. We’ve fixed the data type – parse_ip bug (described over here).
  3. We’ve added a new data type set of functions called read_hexa and to_hexa which are used for decoding and encoding hexadecimals. (don’t forget, we’re working mostly with strings of bytes, so hexadecimal decoder and encoder are highly important).
  4. we’ve added a try call in Bitpy/Packets/PacketCreator.py .

We also suggest that you’ll read this great article on the general changes between Python 2.x and Python 3.x.


Leave a Reply

Your email address will not be published. Required fields are marked *