Tuesday, 15 July 2014

changelog - major changes in python since version 2.2.3 -


I wrote a short dragon script to create a file and calculate the time. I tested it on Fedora 10, and Ubuntu 8.x and it worked well. Python version was 2.5.x

I tried to run it on my production server (an old red hat based Linux server), version 2.2.3 of Python. The script does not work and generates a syntax error in class definition.

To define disk writing speed, the script defines a class with methods to create files on the disc. It starts like this:

  class TestDiskSpeed ​​(): def __init __ (self, round = 1, speed mode = SPEED_MODE_MEGABYTE):  
< P> The definition of class is as error by Python 2.2.3.

What are the major changes in Python 2.2.3 that potentially crash my application? I am using these modules: os, sys, time, stat, gc

Update:

By removing and accepting Python Class from class class definition. But it raises another error on this line:

  size = long (size) size! = No more self._size  

I have entered a PHP developer, just Python programming (maybe a month), and that is very useful for th Used in:

  $ var = (condition)? $ ValueIfTrue: $ valueIfFalse;  

I searched and found that it was done in python as I used for my size variable though it does not look like Python 2.2.3 is.

I was going to insert all the code here (I'm going to release script as LGPL as well), but the code is more than 150 lines (still in development).

This is strange, because it compiles if you delete ) In class definition, however, it says that the empty feet are fine.

Since you are using a lot of Python 2.5 features, so it will have to work hard to find them all. I recommend reading "what's new in python" for every version between 2.2 and 2.5, then coming up with a list of features that you can do your search, like:

  • New style classes
  • Good luck

  • New style classes
  • Understanding and generator
  • Tornieri expression
  • From, most of the new features have a new language keyword (or a new way of using a keyword, in the case of Ternary x if pyy ) Come on, it should not be difficult for them to grep.


    No comments:

    Post a Comment