again.
What is Pyrex?
--
Pyrex is a new language for writing Python extension modules.
It lets you freely mix operations on Python and C data, with
all Python reference counting and error checking handled
automatically.
--
Greg Ewing, Computer Science Dept,
University of Canterbury
I have released a post-competition version of my PyWeek 5 game competition
entry, 555-BOOM!.
http://www.cosc.canterbury.ac.nz/greg.ewing/python/PyWeek5/index.html
This version has been tidied up in various ways, and a few more levels added. I
have made a number of improvements to the level
I have released an updated version of my Albow gui library for PyGame,
incorporating improvements made to it for my PyWeek 5 entry, and also Humerus,
a
skeleton game framework built on Albow.
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/
What is it?
Albow is a rather basic,
Pyrex 0.9.6.1 is now available:
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
This version fixes a few minor problems that turned
up in the initial 0.9.6 release.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you freely mix operations
Pyrex 0.9.6.2 is now available:
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
Another couple of minor fixes.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you freely mix operations on Python and C data, with
all Python reference
Pyrex 0.9.6.4 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Mostly just bug fixes in this release; see CHANGES.txt on
the web site for details.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you freely mix
I've uploaded a new version of my PyWeek 6 game, Assembly Line.
http://media.pyweek.org/dl/6/gregpw6/AssemblyLine-0.5.zip
As a potential Pyggy entry, I'm keen to get some testing and feedback on it.
This version is greatly expanded. Some of the new features include:
* More machine types
Pyrex 0.9.8.2 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
A block of external functions can now be declared nogil at once.
cdef extern from somewhere.h nogil:
...
Also some minor nogil-related bugs have been fixed.
What is Pyrex?
--
Pyrex
and is highly experimental. Let me
know if it works for you and whether you have any problems.
--
Greg Ewing
greg.ew...@canterbury.ac.nz
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html
I have released an updated version of Assembly Line,
my entry in PyWeek 6 and later the Pyggy Awards.
http://media.pyweek.org/dl/1007/greg_pgF09/AssemblyLine-0.8.2.zip
About Assembly Line
---
Become a FADE!
That's Factory Automation Design Engineer for Pixall Manufacturing,
What is SuPy?
-
SuPy is a plugin for the Sketchup 3D modelling application
that lets you script it in Python.
--
Greg Ewing
greg.ew...@canterbury.ac.nz
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http
.
--
Greg Ewing
greg.ew...@canterbury.ac.nz
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html
ALBOW - A Little Bit of Widgetry for PyGame
Version 2.1 is now available.
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/
Highlights of this version:
* OpenGL faciliites
* Music facilities
* Drop-down menus and menu bars
What is Albow?
Albow is a library for creating GUIs
Humerus 2.1 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/Humerus-2.1.0.zip
Online documentation:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/Humerus-2.1.0/doc/
In this version, the code for handling levels has been separated out
into a new pair
PyGUI 2.1 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Highlights of this version:
* Win32:
Fixed bug preventing PyGUI apps from working under pythonw
Fixed incorrect mouse coordinates in ScrollableView
Added more standard cursors
* MacOSX:
PyGUI 2.1.1 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
This is an emergency bugfix release to repair some major
breakage in the gtk version. Also corrects some other
problems.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be
Pyrex 0.9.8.6 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Numerous bug fixes and a few improvements. See the CHANGES
page on the web site for details.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you freely
PyGUI 2.3.1 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
This version incorporates a modification that I hope will
improve the behaviour of ScrollableViews on Windows with
pywin32 builds later than 212.
(There are still problems with it, though. If the Scrollable
PyGUI 2.3.2 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
This version fixes a problem in Cocoa whereby the coordinate
system for drawing in a Pixmap was upside down, and corrects
a slight mistake in the Canvas documentation.
What is PyGUI?
--
PyGUI is a
PyGUI 2.3.3 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Minor update to fix a problem with the previous release on
some versions of MacOSX.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic
PyGUI 2.4 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Highlights of this release:
* Python 3 Compatible on MacOSX and Windows.
* ScrollableView has been overhauled on Windows and should now
work with all builds of pywin32 as far as I know.
What is PyGUI?
for the Sketchup 3D modelling application
that lets you script it in Python.
--
Greg Ewing
greg.ew...@canterbury.ac.nz
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations/
PyGUI 2.5 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Lots of new stuff in this version. Highlights include:
- Improved facilities for customising the standard menus.
- Functions for creating PyGUI Images from PIL images and numpy arrays.
- ListButton - a
PyGUI 2.5.3 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Clipboard access now implemented on MacOSX, plus a few
bug fixes.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic API.
--
Gregory
Jeff Epler wrote:
Unlike Perl, Python implements only a *finite turning machine*
That's interesting -- I didn't know Python could be
used as a lathe. You learn something new every day!
I suppose an infinite turning machine would
be a really *big* lathe...
--
Greg Ewing, Computer Science Dept
require
statements.
Lambdas can give you one-line functions, local variable
binding, if-then-else capabilities, and recursion. Everything
else should be possible from there.
As a fellow named Church once pointed out, lambdas are really
*all* you need in a language...
--
Greg Ewing, Computer Science
it.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
Sion Arrowsmith wrote:
Greg Ewing [EMAIL PROTECTED] wrote:
As a fellow named Church once pointed out, lambdas are really
*all* you need in a language...
... where as others argue that it is impractical not to have
some form of runtime data storage, thereby giving rise to the
separation of Church
, on most of
which it is physically impossible to write characters
without the cursor moving. The best you can do is move
it back to where you want it afterwards.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
to one end of a pipe or socket
and those returned by reading the other end. So you'd
still need to be prepared to buffer and re-chunk the
data. You'd end up doing all of what I outlined above,
with the extra complication of non-blocking I/O thrown
in. I don't see any advantage in it.
--
Greg Ewing
, it would seem that
reading a non-blocking disk file would *never* return
any data...
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
Donn Cave wrote:
Yes, this looks right to me, but I think we're talking
about os.read(), not fileobject.read().
Indeed, you shouldn't be mixing select() with buffered
io, or all kinds of bad things can happen.
Everything I said applies to OS-level reads and
writes, not stdio-level ones.
--
Greg
the __init__ and setConfig operations separate,
and live with having to call setConfig after creating
an object. Factory functions could be provided if
you were doing this a lot.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http
) algorithm
instead of an O(n**2) one.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
again.
What is Pyrex?
--
Pyrex is a new language for writing Python extension modules.
It lets you freely mix operations on Python and C data, with
all Python reference counting and error checking handled
automatically.
--
Greg Ewing, Computer Science Dept,
University of Canterbury
thinking like a
mathematician than a computer scientist!)
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
to exception
that way too, but then there wouldn't be any excuse for
mentioning sex. :-)
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
a contiguous range of integers and an expression
that maps the loop variable to whatever you want.
If you want the maximum possible speed, it *may* be faster
to use a while loop instead and do your own index updating.
But profile to make sure.
--
Greg Ewing, Computer Science Dept,
University of Canterbury
Can someone give me a hint for No. 10? My MindBlaster
card must be acting up -- I can't seem to tune into
the author's brain waves on this one.
I came up with what I thought was a perfectly good
solution, but apparently it's wrong. :-(
--
Greg Ewing, Computer Science Dept,
University
resulted in a very successful family of
languages (UCSD, Turbo, Apple Pascal, etc.)
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
difficulty with that.
Python objects have complete control over which attributes
can be read or written by Python code.
That, together with restricting what the open() function
can do, ought to provide a pretty good sandbox.
--
Greg Ewing, Computer Science Dept,
University of Canterbury
even *mention* it to a beginner.
They don't need to know about it. At all. Really.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
to
all other countries as well... not good for
non-proliferation...
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
. You can only
inherit from more than one built-in type if they have
compatible C structures, and it appears that the two
you're trying to inherit from aren't compatible.
You'll have to think of some way of doing whatever
you're trying to do without inheriting from multiple
gtk types.
--
Greg Ewing
files that it *can* open?
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
better than non-OO. It's a means
to an end, not an end in itself.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
know, there is currently no supported way
of directly creating or modifying cell objects from Python;
it can only be done by some obscure trickery. So the docs
are telling the truth here, in a way. :-)
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New
won't yet have been defined in
file1 at the time file2 is imported.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
(I don't believe there's a wU and conceptually it's sort
of meaningless anyway,
If we ever get quantum computers, presumably wU will
write the newlines in all possible formats simultaneously...
--
Greg Ewing, Computer Science Dept,
University of Canterbury
apparent
support in the API. So I suggest using a single interpeter
with multiple threads.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
!
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
_versions = [
(Carbon, Mac),
(gtk, Gtk),
]
from os import environ as _env
_platdir = _env.get(PYGUI_IMPLEMENTATION)
if not _platdir:
for _testmod
semantic assumptions.
It's arguable that there should perhaps be some default
assumptions made, but the Python developers seem to have
done the Simplest Thing That Could Possibly Work, which
isn't entirely unreasonable.
--
Greg Ewing, Computer Science Dept,
University of Canterbury
arrays, where comparisons return an array of
booleans resulting from applying the comparison to each
element.
* Computer algebra systems and such like, which return a
parse tree as a result of evaluating an expression.
--
Greg Ewing, Computer Science Dept,
University of Canterbury
where
[(1,2), (3,4)].sort() works, whereas [1+2j, 3+4j].sort() doesn't.
To solve that, I would suggest a fourth category of arbitrary
ordering, but that's probably Py3k material.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http
. In imperative programming, often you just
do something for its side effect, and there's no obvious value
to return. Forcing everything to return a value just for the
sake of conceptual purity is an artificiality, in my view.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch
modules.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
variable a different name, such as
'view_class'.
I'm not aware of any specific name for this pattern. I
suppose it could be regarded as an instance of
data-driven programming -- you're putting a piece of
data in the class that describes what is to be done,
instead of writing code to do it.
--
Greg
.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
have the
working directory set, launches the app directly, etc.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
the way it currently works. Guido seems
to be against this sort of thing, though, as he
seems to regard it as a useful feature that the
for-loop control variable is not local to the
loop.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http
Leif K-Brooks wrote:
Noah wrote:
The problem is that my users want to see .sit files.
I know it's sort of silly. Zip files are foreign and frightening to
them.
Would Stuffit open zip files renamed to .sit?
Yes! I just tried it, and it works.
--
Greg Ewing, Computer Science Dept,
University
)
[GCC 3.2 20020903 (Red Hat Linux 8.0 3.2-7)] on linux2
Type help, copyright, credits or license for more information.
str(3.2)
'3.2'
repr(3.2)
'3.2002'
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz
the same dictionary for both scopes:
g = {}
exec stuff_to_define in g, g
# definitions are now in g
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
, defaultfactory())
return defdict
That looks really nice!
I'd prefer a more elegant name than 'defaultdict', though.
How about 'table'?
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org
that no
confusion would result.
Can you think of any situation in which surprising
behaviour would occur through someone thinking the
parallel was closer than it is?
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http
George Sakkis wrote:
As for naming, I would suggest reset() instead of set(), to emphasize that the
key must be there.
make() is ok; other candidates could be add() or put().
How about 'new' and 'old'?
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New
in this case, just passing the
value of x as an implicit parameter to the generator.
How do I disassemble the generator?
You'd have to get hold of the code object for it
and disassemble that. There should be a reference to
it in one of the co_consts slots, I think.
--
Greg Ewing, Computer Science Dept
the first one. If you want to append
data to an existing file, you need to open it in
'a' mode.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
a computing environment
that's truly elegant from the ground up! :-)
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
in creating web sites, maybe you could
introduce her to some simple CGI programming?
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
Sean McIlroy wrote:
I did try it, and it didn't work either. It appears there must be
something wrong with my computer, hopefully something benign.
Just a thought: Is your computer's clock set correctly?
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New
for independent reading and writing at the same
time. C stdio implementations tend to get confused if
you try to do that.
You may have other problems as well, but you'll at least
need to open two separate file objects.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New
at all, including other
functions and classes defined in the same module --
which you may find rather inconvenient!
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python
.
* The 'and' and 'or' operators short-circuit: if the first
operand determines the result, the second operand is not
evaluated.
* Negative list indices are counted from the end of the
list; e.g. aList[-1] means the last item of aList.
Hope that helps,
--
Greg Ewing, Computer Science Dept,
University
a little weaker here because calling iter doesn't always
produce objects of type iter:
Indeed, I see iter() as being more like len(), which
is clearly a function, not a constructor. Making iter()
a type and giving it class methods would be strange.
--
Greg Ewing, Computer Science Dept,
University
Ville Vainio wrote:
The issue that really bothers me here is bloating the builtin
space. We already have an uncomfortable amount of builtin
functions.
Maybe what we're really after here is the notion of a
builtin module that's pre-imported into the builtin
namespace.
--
Greg Ewing, Computer
Paul McGuire wrote:
The code was filled with two key variables: t_1 and t_l. Printing out
the source in a Courier font made these two vars completely
indistinguishable,
Are you sure it was Courier? I'm looking at it now
in Courier, and they are different, although very
similar.
--
Greg Ewing
1.
3) You have a starting point and an ending
point: lst[s:e+1].
Again, you don't really have an ending point.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python
[EMAIL PROTECTED] wrote:
I'd love to do the whole thing in Python, but I don't know how to make
a DLL purely from Python.
I don't think you can do it *purely* in Python. You'll at
least need a C or Pyrex wrapper which dispatches to Python
code.
--
Greg Ewing, Computer Science Dept,
University
(
lambda self: getattr(self, getter_name)(),
lambda self, value: getattr(self, setter_name)(value),
None,
doc)
Usage example:
class MyClass(object):
...
spam = overridable_property('spam', Favourite processed meat product)
...
--
Greg Ewing, Computer
or not when you write the code. If not, you'll just
have to do it the new way.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
of a program,
to be seen by the user.
* repr() is for debugging output, and should indicate
reasonably unambiguously the *type* of the object.
When debugging, it's often at least as important to
know what type of object you have as what value it
has.
--
Greg Ewing, Computer Science Dept
if
you want.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
drank this afternoon, for instance, did
not surprise me, but I still enjoyed it.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
of the cake-ingestion
operation will become apparent.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
gf gf wrote:
Really! That's a pity... Instead of trying to
recreate a repository the size of CPAN, a Python
interface to Perl modules is really called for.
When Parrot comes on line, this presumably will
become trivial...
--
Greg Ewing, Computer Science Dept,
University of Canterbury
By the way, is the Parrot project still alive,
or has it been given up on?
Not that I actually want it, but the idea is
kind of morbidly fascinating.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http
, not the
RealFoo.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
.__class__, self.__class__.__dict__, or some other magic
properties.
such as
def unpickle(self):
new_self = pickle.load(open(self.getFilePath('pickle')))
self.__class__ = new_self.__class__
self.__dict__.update(new_self.__dict__)
--
Greg Ewing, Computer Science Dept,
University
something that gets into Quote of the
Week, and it's attributed to someone else! :-) :-) :-)
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
database copying.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
Peter Maas wrote:
This is only true for trivial bash scripts. I have seen bash scripts
which were quite hard to read especially for beginners.
I've seen shell scripts which are quite hard to read
even for experts!
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch
Mike Meyer wrote:
Gee, it's changed from eight to eighty. Probably because eight is a
small app by todays standards. Then again, it's not like 80 is large
these days.
Yeah, it's probably time to upgrade it to 800. :-)
--
Greg Ewing, Computer Science Dept,
University of Canterbury
type(foo)
print foo
The output is:
type 'str'
This is a dedented (or perhaps demented?) string.
It spans multiple lines.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman
at compile time, so the compiler misses it,
and the run-time evaluation fails.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list
.
That's probably a large part of the reason why nothing
like it has so far been seriously considered for
adoption.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python
()
['a', 'b']
a.split()
['a']
.split()
[]
and
**.split(*)
['', '', '']
*.split(*)
['', '']
.split(*)
['']
The split() method is really doing two somewhat different things
depending on whether it is given an argument, and the end-cases
come out differently.
--
Greg Ewing, Computer Science Dept
... And
there are probably some cases where this code still wouldn't work...
Note that in general it's impossible to tell exactly
which function object was involved, since there could
be more than one function object sharing the same code
object, and the frame only references the code object.
--
Greg Ewing, Computer
, there wasn't any established
convention.
Hopefully the stdlib naming will gradually get ironed
out as the oldest bits get deprecated. The tutorial
could probably do with being updated, too.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http
)):
return (x1 + y1, x2 + y2)
In cases like this, it can help to make things more concise
and probably also slightly more efficient.
it looks like one of those language features that make
committing atrocities an order of magnitude easier.
I don't remember ever being seriously burned by using it.
--
Greg
1 - 100 of 485 matches
Mail list logo