ANN: Pyrex 0.9.3.1

2005-09-16 Thread Greg Ewing
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

ANN: 555-BOOM! version 0.6

2007-09-25 Thread Greg Ewing
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

ANN: Albow 1.1 and Humerus 1.0

2007-09-25 Thread Greg Ewing
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,

ANN: Pyrex 0.9.6.1

2007-10-08 Thread Greg Ewing
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

ANN: Pyrex 0.9.6.2

2007-10-10 Thread Greg Ewing
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

ANN: Pyrex 0.9.6.4

2007-12-01 Thread Greg Ewing
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

ANN: Assembly Line 0.5

2008-05-08 Thread Greg Ewing
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

ANN: Pyrex 0.9.8.2

2008-05-18 Thread Greg Ewing
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

ANN: SuPy for Python 2.5 on Windows

2009-02-11 Thread Greg Ewing
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

ANN: Assembly Line 0.8.2

2009-02-16 Thread Greg Ewing
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,

ANN: SuPy 1.5

2009-02-23 Thread Greg Ewing
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

ANN: SuPy 1.6

2009-02-23 Thread Greg Ewing
. -- 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

ANN: Albow 2.1

2009-09-25 Thread Greg Ewing
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

ANN: Humerus 2.1

2009-10-02 Thread Greg Ewing
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

ANN: PyGUI 2.1

2009-11-14 Thread Greg Ewing
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:

ANN: PyGUI 2.1.1

2009-11-19 Thread Greg Ewing
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

ANN: Pyrex 0.9.8.6

2010-02-24 Thread Greg Ewing
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

ANN: PyGUI 2.3.1

2010-11-19 Thread Greg Ewing
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

ANN: PyGUI 2.3.2

2010-12-16 Thread Greg Ewing
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

ANN: PyGUI 2.3.3

2010-12-19 Thread Greg Ewing
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

ANN: PyGUI 2.4

2011-03-19 Thread Greg Ewing
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?

ANN: SuPy 1.6 for Snow Leopard and Python 2.7

2011-04-24 Thread Greg Ewing
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/

ANN: PyGUI 2.5

2011-06-17 Thread Greg Ewing
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

ANN: PyGUI 2.5.3

2011-07-16 Thread Greg Ewing
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

Python as a machine tool (Re: Is Python as capable as Perl for sysadmin work?)

2005-02-09 Thread Greg Ewing
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

Re: turing machine in an LC

2005-02-09 Thread Greg Ewing
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

Re: Big development in the GUI realm

2005-02-09 Thread Greg Ewing
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

:-)

2005-02-10 Thread Greg Ewing
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

Re: ncurses' Dark Devilry

2005-11-29 Thread Greg Ewing
, 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

Re: non blocking read()

2004-12-01 Thread Greg Ewing
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

Re: non blocking read()

2004-12-01 Thread 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

Re: non blocking read()

2004-12-02 Thread Greg Ewing
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

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Greg Ewing
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

Re: efficient intersection of lists with rounding

2004-12-02 Thread Greg Ewing
) 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

ANN: Pyrex 0.9.3.1

2005-09-16 Thread Greg Ewing
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

Re: Q: ...Learning with Python ...a property that addition and multiplication have...

2005-05-25 Thread Greg Ewing
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

Re: Just remember that Python is sexy

2005-05-26 Thread Greg Ewing
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

Re: Pyrex: step in for loop

2005-05-26 Thread Greg Ewing
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

Python Challenge 10?

2005-05-26 Thread Greg Ewing
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

Re: What are OOP's Jargons and Complexities?

2005-06-01 Thread Greg Ewing
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

Re: Python as client-side browser script language

2005-06-01 Thread Greg Ewing
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

Re: Beginner question: Logs?

2005-06-02 Thread Greg Ewing
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

Re: Two questions

2005-06-02 Thread Greg Ewing
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

Re: [python-gtk] problem with multiple inheritance

2005-06-02 Thread Greg Ewing
. 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

Re: need some cgi help please

2005-06-08 Thread 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

Re: OO re-factoring (was Pythonese/Efficiency/Generalese critique [on Tutor])

2005-06-08 Thread Greg Ewing
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

Re: Writing func_closure?

2005-06-08 Thread Greg Ewing
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

Re: circular import Module

2005-06-08 Thread Greg Ewing
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

Re: \r\n or \n notepad editor end line ???

2005-06-08 Thread Greg Ewing
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

Re: Embedding: many interpreters OR one interpreter with many thread states ?

2005-06-08 Thread Greg Ewing
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

Re: __init__.py in packages

2005-06-08 Thread Greg Ewing
! -- 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

Re: Annoying behaviour of the != operator

2005-06-08 Thread Greg Ewing
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

Re: Annoying behaviour of the != operator

2005-06-08 Thread Greg Ewing
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

Re: Annoying behaviour of the != operator

2005-06-08 Thread Greg Ewing
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

Re: Abstract and concrete syntax

2005-06-08 Thread Greg Ewing
. 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

Re: circular import Module

2005-06-13 Thread Greg Ewing
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

Re: class attribute to instance attribute

2005-07-05 Thread Greg Ewing
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

Re: parameter name conflict. How to solve?

2005-03-08 Thread Greg Ewing
. -- 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

Re: Creating desktop icons for Innosetup file

2005-03-13 Thread Greg Ewing
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

Re: Lisp-likeness

2005-03-16 Thread Greg Ewing
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

Re: How to create stuffit files on Linux?

2005-03-20 Thread Greg Ewing
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

Re: printing anomaly

2005-03-20 Thread Greg Ewing
) [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

Re: exec src in {}, {} strangeness

2005-03-21 Thread Greg Ewing
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

Re: Pre-PEP: Dictionary accumulator methods

2005-03-21 Thread Greg Ewing
, 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

Re: For loop extended syntax

2005-03-21 Thread Greg Ewing
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

Re: missing? dictionary methods

2005-03-21 Thread Greg Ewing
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

Re: Python scope is too complicated

2005-03-21 Thread Greg Ewing
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

Re: Simple account program

2005-03-21 Thread Greg Ewing
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

Re: Python for a 10-14 years old?

2005-03-29 Thread Greg Ewing
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

Re: Python for a 10-14 years old?

2005-03-29 Thread Greg Ewing
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

Re: mysteriously nonfunctioning script - very simple

2005-03-30 Thread Greg Ewing
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

Re: ossaudiodev full duplex

2005-03-30 Thread Greg Ewing
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

Re: Turn of globals in a function?

2005-03-30 Thread Greg Ewing
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

Re: Python List Issue

2005-03-30 Thread Greg Ewing
. * 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

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-31 Thread Greg Ewing
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

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-31 Thread Greg Ewing
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

Re: Things you shouldn't do

2005-03-31 Thread Greg Ewing
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

Re: Grouping code by indentation - feature or ******?

2005-03-31 Thread 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

Re: Making a DLL with python?

2005-04-03 Thread Greg Ewing
[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

Re: property and virtuality

2005-04-03 Thread Greg Ewing
( 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

Re: string goes away

2005-04-03 Thread Greg Ewing
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

Re: what's the use of __repr__?when shall I use it?

2005-04-03 Thread Greg Ewing
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

Re: Super Newbie Question

2005-04-04 Thread Greg Ewing
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

Re: boring the reader to death (wasRe: Lambda: the Ultimate Design Flaw

2005-04-06 Thread Greg Ewing
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

Re: Lambda: the Ultimate Design Flaw

2005-04-06 Thread Greg Ewing
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

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-07 Thread Greg Ewing
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

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-07 Thread Greg Ewing
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

Re: Using weakrefs instead of __del__

2005-04-07 Thread Greg Ewing
, 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

Re: within a class, redefining self with pickled file

2005-04-07 Thread Greg Ewing
.__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

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-13 Thread Greg Ewing
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

Re: The convenient database engine for a Distributed System

2005-04-13 Thread Greg Ewing
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

Re: Programming Language for Systems Administrator

2005-04-13 Thread Greg Ewing
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

Re: Best editor?

2005-04-13 Thread Greg Ewing
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

Re: Inelegant

2005-04-19 Thread Greg Ewing
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

Re: eval function not working how i want it dag namn

2005-04-19 Thread Greg Ewing
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

Re: pre-PEP: Simple Thunks

2005-04-19 Thread Greg Ewing
. 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

Re: Behaviour of str.split

2005-04-19 Thread Greg Ewing
() ['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

Re: How to get a Function object from a Frame object

2005-04-19 Thread Greg Ewing
... 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

Re: packages

2005-04-19 Thread Greg Ewing
, 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

Re: def a((b,c,d),e):

2005-04-19 Thread Greg Ewing
)): 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   2   3   4   5   >