282x Filetype PDF File size 0.38 MB Source: www.uio.no
Slides from INF3331 lectures
- Python functions and classes revisited
Joakim Sundnes, Ola Skavhaug and Hans Petter Langtangen
Dept. of Informatics, Univ. of Oslo
&
Simula Research Laboratory
November2014
Contents
Classes and object oriented programming in Python vs other
OOPlanguages;
Classes are also objects
Nodeclaration of variables; attributes can be added on the fly,
selfusedtodistinguish between local and instance
variables, ...
Function programming, focusing on the “special features” of
Python functions;
Functions are regular objects; passed as arguments, returned
from functions, modified inside functions etc...
c
www.simula.no/˜hpl
Slides from INF3331 lectures- Python functions and classes revisited – p.1/33
Moreinfo
Ch. 8.6 in Python scripting for computational science
Ch. 2 in Illustrating Python via bioinformatics examples
Chapter 6 and 7 in Python essential reference by D. M. Beazley
Python Reference Manual (special methods in 3.3)
c
www.simula.no/˜hpl
Slides from INF3331 lectures- Python functions and classes revisited – p.2/33
Pythonclasses revisited
c
www.simula.no/˜hpl
Python classes revisited – p.3/33
no reviews yet
Please Login to review.