pyAlbum
Josiah Carlson
jcarlson at nospam.uci.edu
Sun Feb 29 15:04:10 EST 2004
Your presentation is inaccurate.
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide3.jpg.htm
Python /is not a derivative, nor a successor/ to ABC. To know why, read
the following two articles:
http://www.artima.com/intv/python.html
http://www.artima.com/intv/pyscale.html
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide6.jpg.htm
Portable: works on any platform with a decent C compiler, or platforms
with Java support (via Jython).
I also believe it is byte-code compiled whenever possible (user can
write to the filesystem).
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide8.jpg.htm
At the command line:
C:\winnt>python
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello"
hello
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide10.jpg.htm
One thing to note, raw_input only returns strings. C++'s cin can read
ints, floats, etc.
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide15.jpg.htm
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide27.jpg.htm
It is extremely bad form to use the name 'str' in any context. Also,
slicing is usable on any sequence; lists, strings, tuples, or really any
class with a __getslice__ method.
Perhaps you need to read up on the difference between mutable and
immutable sequences, it would make discussion about them easier.
http://www.python.org/doc/current/lib/typesseq.html
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide18.jpg.htm
Suggests that only strings can be used as keys. Reality is that any
immutable type can be used as a key; strings, tuples, integers, floats,
types themselves. You can also nest them with tuples, ('hello', 5, int)
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide22.jpg.htm
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide28.jpg.htm
No need for functional semantics on returns, using "return val" is
sufficient.
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide23.jpg.htm
if <expression>:
statements
elif <expression>:
statements
else:
statements
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide24.jpg.htm
Parenthesis not required for 'while' loops, or really any conditional
expression, unless you need to be explicit about operation associations.
http://www24.brinkster.com/premshree/python-seminar-210204/slides/pySlide30.jpg.htm
Python classes can contain almost anything your heart desires. Static
and dynamic class and instance variables are all possible.
Some fairly rudimentary fact-checking would have prevented the
errors/oversights listed above.
- Josiah
More information about the Python-list
mailing list