Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely hated it, having learned C++ a few years prior. They didn't teach Lisp

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
Bruno Desthuilliers [EMAIL PROTECTED] writes: DH a écrit : (snip) It is by design. Python is dynamically typed. It is essentially an interpreted scripting language like javascript or ruby or perl, It's not a scripting language, and it's not interpreted. Of course it is. What do you

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
Fredrik Lundh [EMAIL PROTECTED] writes: Alexander Schmolck wrote: What's far more interesting to me, however, is that I think there a good reasons to suspect python's slowness is more of a feature than a flaw: I'd not be suprised if on the whole it greatly increases programmer

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Alexander Schmolck
Fredrik Lundh [EMAIL PROTECTED] writes: Alexander Schmolck wrote: You might want to argue about whether scriping language is a meaningful and useful concept, but it's really hard to see how you could talk about scripting languages without including python. define scripting language

py-ext: casting pointers to ints on 32bit and 64bit systems

2006-01-27 Thread Alexander Schmolck
what's the best approach to write C(++)-extension code that has to create a python int from a C pointer and vice versa so that it works smoothly on 32 bit and 64 platforms (on which sizeof(int) != sizeof(*void)) equally work (under unix,macwindows and with gcc, vc and borland)? Currently the

Re: regexp for sequence of quoted strings

2005-05-25 Thread Alexander Schmolck
gry@ll.mit.edu writes: I have a string like: {'the','dog\'s','bite'} or maybe: {'the'} or sometimes: {} [FYI: this is postgresql database array field output format] which I'm trying to parse with the re module. A single quoted string would, I think, be: r\{'([^']|\\')*'\} what

Re: Python Polymorphism

2005-05-13 Thread Alexander Schmolck
Fredrik Lundh [EMAIL PROTECTED] writes: Carlos Moreira wrote: Supose that I want to create two methos (inside a class) with exactly same name, but number of parameters different: that's known as multimethods, or multiple dispatch. No -- multiple dispatch is something entirely different.

Re: How to generalize a function?

2005-04-24 Thread Alexander Schmolck
Thomas Köllmann [EMAIL PROTECTED] writes: confFile.close You want ``confFile.close()`` -- the above won't do anything [1]. 'as Footnotes: [1] Best practice would be something like this (don't worry to much about it -- it just ensures the file is properly closed, even if something

Re: Array of Chars to String

2005-04-19 Thread Alexander Schmolck
James Stroud [EMAIL PROTECTED] writes: But this seems ugly. I especially don't like newstr += lttr because it makes a new string every time. I am thinking that something like this has to be a function somewhere already or that I can make it more efficient using a built-in tool. .join

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Alexander Schmolck
Beni Cherniavsky [EMAIL PROTECTED] writes: The relatively recent improvement of the dict constructor signature (``dict(foo=bar,...)``) obviously makes it impossible to just extend the constructor to ``dict(default=...)`` (or anything else for that matter) which would seem much less ad hoc.

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Alexander Schmolck
Raymond Hettinger [EMAIL PROTECTED] writes: The rationale is to replace the awkward and slow existing idioms for dictionary based accumulation: d[key] = d.get(key, 0) + qty d.setdefault(key, []).extend(values) In simplest form, those two statements would now be coded more

[ANN] mlabwrap v0.9 released

2005-02-28 Thread Alexander Schmolck
This release just adds OS X support to setup.py (thanks to Josh Marshall). I've also made some recent improvements to the website, based on user feedback. In the absence of any bug reports so far I'd tentatively consider mlabwrap as stable. Dowload from: http://mlabwrap.sourceforge.net/ What

[ANN] mlabwrap v0.9b3

2005-02-19 Thread Alexander Schmolck
I have recently uploaded mlabwrap v0.9b3, a high-level python to matlab(tm) bridge, you can get it from http://mlabwrap.sourceforge.net/ It should work with recent python =2.3 and matlab(tm) =6.0; I've used it extensively myself but this is the first announcement to a wider public -- so I'd very

Re: Python, Matlab and AI question

2005-02-18 Thread Alexander Schmolck
Robert Kern [EMAIL PROTECTED] writes: dataangel wrote: I'm a student who's considering doing a project for a Machine Learning class on pathing (bots learning to run through a maze). The language primarily used by the class has been Matlab. I would prefer to do the bulk of the project in

Re: Python, Matlab and AI question

2005-02-18 Thread Alexander Schmolck
Robert Kern [EMAIL PROTECTED] writes: Alexander Schmolck wrote: Actually, I've written a highlevel matlab-python bridge (based on bugfixed and slightly extended version of the original pymat) which is quite up-to-date; by and large it makes using matlab from python as easy as if matlab

<    1   2