Main Content
Sludge off the mountain, and Python and PHP Archive - Originally posted on "The Horse's Mouth" - 2006-11-27 18:28:34 - Graham Ellis
Is Python 2.3 compatible with version 2.2? How about PHP 5.1 with PHP 4.4?
In an ideal world, the answer to every such compatibility question would be "yes, it is" but it's not always quite that simple. Python's upwards compatibility is excellent - as a language, it was designed for the purpose for which it's used to this day, and it's not overburdened with facilities, especially redundant ones, that make onward extension awkward. PHP, alas, started as "Personal Home Pages: and has grown to something much more powerful ... meaning that a few of the (then excellent) early decisions have had to be revisited and there have been a few compatibility issues - sometimes solved via the php.ini configuration file. (register_globals and magic_quotes come to mind ...).
However, there's always the exception to disprove the rule ... and I've been talking about Python compatibility today, and how the "yield" keyword was added for generators. "That would only be a problem if you happened to have a variable of that name" says I. "We do, quite often" says one of my trainees. "We're very often forecasting the yield of sludge running off a mountain in wet weather"
Some other articles
Y105 - Functions, Modules and Packages From and Import in Python - where is the module loaded from? Embedding more complex code into a named block Nesting decorators Recursion in Python - the classic example What are callbacks? Why use them? An example in Python What is the difference between a function and a method? Reading command line parameters in Python A good example of recursion - a real use in Python Python - even named code blocks are objects Multiple yields and no loops in a Python generator? Python functions - an introduction to how they work Python varables - checking existance, and call by name or by value? Exception, Lambda, Generator, Slice, Dict - examples in one Python program vargs in Python - how to call a method with unknown number of parameters Optional positional and named parameters in Python Default local - a good choice by the author of Python Static variables in Python? Python timing - when to use a list, and when to use a generator Functions are first class variables in Lua and Python Finding all the unique lines in a file, using Python or Perl Python Packages - groupings of modules. An introduction Static variables in functions - and better ways using objects Passing optional and named parameters to python methods Catching the fishes first? Passing parameters to Python functions - the options you have Returning multiple values from a function call in various languages - a comparison Using an exception to initialise a static variable in a Python function / method Python - some common questions answered in code examples Passing a variable number of parameters in to a function / method Program for reliability and efficiency - do not duplicate, but rather share and re-use Optional and named parameters to Python functions/methods Python - access to variables in the outer scope Global and Enable - two misused words! Good example of recursion in Python - analyse an RSS feed Sample code with errors in it on our web site Optional parameters to Python functions Multiple returns from a function in Python Conversion of OSI grid references to Eastings and Northings Dynamic code - Python Optional and named parameters in Python What to do with a huge crop of apples Anonymous functions (lambdas) and map in Python Sharing variables with functions, but keeping them local too - Python Global - Tcl, PHP, Python Python Script - easy examples of lots of basics Returning multiple values from a function (Perl, PHP, Python) A better alternative to cutting and pasting code Function / method parameters with * and ** in Python It's the 1st, not the 1nd 1rd or 1th. This article Python - A list of methods Recursion in Python Python - function v method Dynamic functions and names - Python Do not duplicate your code Cottage industry or production line data handling methods Python modules. The distribution, The Cheese Shop and the Vaults of Parnassus. Python - block insets help with documentation Python's Generator functions Difference between import and from in Python What is a callback? Code and code maintainance efficiency Call by name v call by value Lambdas in Python Python generator functions, lambdas, and iterators Distance Learning Variable Scope Y101 - Introduction to Python Progress on moving from Python 2 to Python 3 - training for both versions Python - an interesting application We not only teach PHP and Python - we teach good PHP and Python Practice! Python in an afternoon - a lecture for experienced programmers Python v Ruby Python and the Magic Roundabout This article Python is like a narrowboat Is Perl being replaced by PHP and Python? Python makes University Challenge Python 3000 - the next generation Python modules. The distribution, The Cheese Shop and the Vaults of Parnassus. Why reinvent the wheel Linux training Glasgow, Python programming course Dundee Choosing the right language Database or Progamming - which to learn first? Central London Courses - Perl, PHP, Python, Tcl, MySQL Bridging to the customer requirement Programming languages - a comparison H101 - Introduction to PHP The power of scripting We not only teach PHP and Python - we teach good PHP and Python Practice! Learning to Program ... in PHP. Course examples. PHP Course - for hobby / club / charity users. PHP - Parse error: syntax error, unexpected $end ... Perl v PHP, choosing the right language Q - Should I use Perl or Python? From Web to Web 2 The HTML++ Metalanguage This article The LAMP Cookbook - Linux, Apache, MySQL, PHP / Perl Syntax checking in PHP Is Perl being replaced by PHP and Python? Remember a site's non-technical issues too Hot answers in PHP Why reinvent the wheel Testing you Perl / PHP / MySQL / Tcl knowledge PHP - London course, Melksham Course, Evening course Choosing the right language It's REALLY easy to add a little PHP Learning to program in Perl or PHP FTP - how to make the right transfers Central London Courses - Perl, PHP, Python, Tcl, MySQL Bridging to the customer requirement Happy Birthday, PHP Programming languages - a comparison Too many Perls Portrait of the author PHP v Java Case Sensitive? Evening classes to learn PHP PHP - onwards and upwards