Your search query "linkto%3A%22API%22" didn't return any results. Please change some terms and refer to HelpOnSearching for more information.
(!) Consider performing a full-text search with your search terms.

Clear message

API is a shortcut for "Application Programming Interface".

Loosely defined, API describes everything an application programmer needs to know about piece of code to know how to use it. The idea is that the programmer knows all Signatures of classes and methods; their parameters, parameter types (or behaviour) as well as return values.

A programmer should always write against interface (API), not against implementation. This is especially important in Python. If you know a class has method subfrob(), you'd be better off with

if hasattr(obj, 'subfrob'):

instead of using isinstance(obj, SomeSpecificClass). Effectively, this is applying idiom "if it walks like a duck, quacks like a duck..." it's a duck alright. Controlling behaviour depending on class instance used is more like programming to implementation, whereas programming against "signature" is more like programming against interface.

An example of API can be found at Voicent Simple Telephone Call API. The published class is used to encapsulate the implementation details.

Unable to edit the page? See the FrontPage for instructions.