Re: Python less error-prone than Java

2006-06-03 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Neil Hodgson <[EMAIL PROTECTED]> wrote: >Alan Morgan wrote: > >> Since Java doesn't allow function overloading that clearly can't be >> the way. J2SE 5.0 allows generic classes and functions that operate >> on generic

Re: Python less error-prone than Java

2006-06-04 Thread Alan Morgan
; >> Since Java doesn't allow function overloading that clearly can't be >> the way. J2SE 5.0 allows generic classes and functions that operate >> on generic containers. There are some gotchas, but it's not drastically >> more complex than the original int-only

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
;jython fibo.py Position 0: 0 Position 1: 1 Position 2: 1 Position 3: 2 Position 4: 3 Position 5: 5 Position 6: 8 Of course, the efficiency is different across cpython vs. jython, but it's nice to have the same pythonic code running across both. And when jython progresses beyond 2.1, (any day

Re: XML, JSON, or what?

2006-06-08 Thread Alan Kennedy
and robust as XML, in most languages. > I would rather make a decision now, otherwise I will have a lot of > changes to make later on. Does anyone have any recommendations? I'd go with JSON, for simplicity and portability. If you have any specific questions about it, ask. regards, --

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Alan Kennedy] >> On jython 2.1, I use something like this >> >> #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> try: >> enumerate >> except NameError: >> def enumerate(iterable): >> results = [] ; ix = 0 >> for item in iterable: &g

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Alan Kennedy] > On jython 2.1, I use something like this > #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > try: > enumerate > except NameError: > def enumerate(iterable): > results = [] ; ix = 0 > for item in iterable: > results.append( (ix, item) ) >

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
. While the comment "using a user-defined enumerate is slower than using the builtin" may be true, it has no bearing on the code I posted, which is all I'm trying to say ... -- alan kennedy ------ email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Alan Kennedy] >> Your comment makes "using a user-defined enumerate [on cpython] is >> slower than using the built-in version" makes no sense in relation to >> the code I posted Fredrik Lundh wrote: > try combining with the second sentence in my post. OK, so putt

Re: XML, JSON, or what?

2006-06-08 Thread Alan Kennedy
ed for eval: there are safe JSON codecs for python, http://cheeseshop.python.org/pypi?%3Aaction=search&description=json And one for javascript, http://www.json.org/js.html http://www.json.org/json.js And most other languages you're likely to come acro

Re: Writing PNG with pure Python

2006-06-09 Thread Alan Isaac
actory/lib/image/png.py It's your code, so you get to license it. But if you wish to solicit patches, a more Pythonic license is IMHO more likely to prove fruitful. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-28 Thread Alan Franzoni
7-ab1e-4bcb-99c0-57ac5a3a9742 -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Rremove .xyz from my address in order to contact me. - GPG Key Fingerprint: 5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E - Blog: http://laterradeglieroi.verdiperronchi.

Re: compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-28 Thread Alan Franzoni
Il 28 Jun 2006 06:29:58 -0700, per9000 ha scritto: > Is the newest Ironpython really as old as from 2004 July 28 (as stated > on http://www.ironpython.com/)? Sorry again, the up to date page is the following one: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython -- Alan Fr

Re: Numeric help!

2006-06-29 Thread Alan Isaac
p://www.scipy.org/Cookbook ) Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance error: class Foo has no attribute "bar"

2006-07-09 Thread Alan Franzoni
dictionary > just for Character, the attributes are listed. Are you sure attrib_dict is a class attribute? Aren't you defining it in charachter's __init__ method, thus making it an instance attribute? -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contat

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Alan Franzoni
ATE: I tried with Eclipse+Pydev, and using koi8_r I seems to be able to simply copy&paste a piece of the ixbt.com homepage in the editor I can save and use it correctly. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Remove .xyz from my address in or

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Alan Franzoni
Kirill Simonov si è divertito a scrivere: > On Sun, Nov 19, 2006 at 12:33:39PM +0100, Alan Franzoni wrote: > No, I would prefer the editor to save the .py files with non-ASCII > characters in UTF-8 encoding adding the BOM at the beginning of the > file. This will allow the in

Re: How to refer to Python?

2006-11-29 Thread Alan Isaac
r_1_1/102-2818366-5466542?ie=UTF8&s=books> Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use MySQL without MySQLdb module

2006-12-06 Thread Alan Franzoni
l database and just write raw sql and pull raw data from it, but this will prevent you from the chance of using more enhanced db tools like sqlalchemy, and it's highly discouraged as well as it's really prone to errors. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla m

Re: permutations - fast & with low memory consumption?

2006-12-19 Thread Alan Isaac
yield [lst[i]]+x else: yield lst hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another list compr. suggestion

2006-01-22 Thread Alan Franzoni
for x in y if z(x)] You've got to stick to the present syntax. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Rremove .xyz from my address in order to contact me. - GPG Key Fingerprint: 5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E -- htt

Re: Python module for LX200 telescope command set

2006-01-31 Thread Alan Kennedy
Control Language (ACL). Products that support telescope control via ASCOM are Starry Night by SPACE.com, MaxIm DL V3 by Cyanogen Productions, and ACP2 by DC3 Dreams. """ HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I dynamically create functions without lambda?

2006-02-01 Thread Alan Morgan
are a lot more stupid people than clever people out there I think the more likely scenario is having to maintain unmaintainable code written by a complete idiot whose programming knowledge comes solely from books whose titles end with "In 7 Days". Oh, and I'd hope that code reviews,

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Alan Morgan <[EMAIL PROTECTED]> wrote: > ... >> Excessive cleverness can lead to unmaintainable code. So can excessive >> stupidity. > >+1 QOTW. import blush >> Sinc

Re: HTMLDocument and Xpath

2006-02-03 Thread Alan Kennedy
7;, doc_node.documentElement) test = Evaluate('/html/body/table/tr/td[1]', doc_node.documentElement) HTH, Alan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Too Many if Statements?

2006-02-07 Thread Alan Morgan
000, and 5 simple if statements and ran them. 1 was okay, 25000 gave a bizarre internal error, and 5 segfaulted and died. My system has plenty of memory and it isn't obvious to me why python should be so bothered about this. I'm not sure why I can have 10x the number of if st

Re: Too Many if Statements?

2006-02-07 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Bryan Olson <[EMAIL PROTECTED]> wrote: >Alan Morgan wrote: >> slogging_away wrote: >> >>>Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 >>>32 bit (Intel)] on win32, and have a

Re: Jython inherit from Java class

2006-02-08 Thread Alan Kennedy
s be: > fit.FitServer.__init__(self, host, port, verbose) I'm not sure the latter is cause of your problems, but it might be. HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Too Many if Statements?

2006-02-08 Thread Alan Morgan
when you are using an ancient version of python. Retesting with a newer version didn't find any problems. Alan -- Defendit numerus -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Alan Kennedy
[Terry Hancock] > So what's a 1-element tuple, anyway? A "mople"? "monople"? > It does seem like this lopsided pythonic creature (1,) ought > to have a name to reflect its ugly, newbie-unfriendly > nature. It's a "trip-you-uple", which yo

Re: Clarity: GIL, processes and CPUs etc

2006-02-15 Thread Alan Kennedy
you need to de/serialise objects/parameters for transmission between those processes. -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: PyXML SAX Q?

2006-02-16 Thread Alan Kennedy
Maybe I could read the XML from the socket directly into the parser. You can find exactly what you need in this old thread about incremental XML parsing. Parsing XML streams http://groups.google.com/group/comp.lang.python/msg/e97309244914343b? -- alan kennedy -

Re: Psychic bug

2006-02-22 Thread Alan Franzoni
, old value: %s, new value: %s " % ( letter, gen[letter], base) in place of your two prints in the if block, it should help you. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. To contact me, remove .xyz from my email

Re: Pure python implementation of string-like class

2006-02-25 Thread Alan Kennedy
er represent a character. """ So UTF-16 has no "width" to compare to, no more than utf-8 does. I wonder what character set the OP is dealing with, if it's not representable with Unicode. Presumably it's not a modern character set? -- alan kennedy ---

Re: Use empty string for self

2006-03-01 Thread Douglas Alan
Roy Smith <[EMAIL PROTECTED]> writes: > Terry Hancock <[EMAIL PROTECTED]> wrote: >> However, there is a slightly less onerous method which >> is perfectly legit in present Python -- just use "s" >> for "self": > This is being different for the sake of being different. Everybody *knows* > what

Re: generators shared among threads

2006-03-05 Thread Alan Kennedy
p://groups.google.com/group/comp.lang.python/browse_frm/thread/76aa2afa913fe4df/a2ede21f7dd78f34#a2ede21f7dd78f34 Also contained in that thread is an implementation of Queue.Queue which supplies values from a generator, and which does not require a separate thread to generate val

Proper licensing and copyright attribution for extracted Python code

2007-06-14 Thread Douglas Alan
rived carries the // following copyright: // // Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python // Software Foundation. // // The modifications to the original software, which are contained herein, // are

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Try suggesting on a Lisp or Scheme group that having only one type > of syntax (prefix expressions) lacks something and that they should > add variety in the form of statement syntax ;-) Hint: some Lispers > have bragged here about the simplicity of 'one

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > My only point was that Sussman is an odd person to be criticizing > (somewhat mistakingly) Python for being minimalist. I think that being a language minimalist is very different from believing that there should be exactly one obvious way to do everythi

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Here's the situation. Python is making inroads at MIT, Scheme home turf. > The co-developer of Scheme, while writing about some other subject, tosses > in an off-the-wall slam against Python. Someone asks what we here think. > I think that the comme

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
Kay Schluehr <[EMAIL PROTECTED]> writes: > On 15 Jun., 22:58, Douglas Alan <[EMAIL PROTECTED]> wrote: >> For instance, I believe that Python is now too big, and that much >> of what is in the language itself should be replaced with more >> general Scheme-

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 15 Jun 2007 17:05:27 -0400, Douglas Alan wrote: >> You are ignoring the fact that Scheme has a powerful syntax extension >> mechanism (i.e., hygenic macros), which means that anyone in the world >> can ba

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > > You are ignoring the fact that > This prefactory clause is false and as such it turns what was a true > statement into one that is not. Better to leave off such ad hominisms and > stick with the bare true statement. You went on about how Gerry Sus

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-16 Thread Douglas Alan
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > Macros? Unfortunately to my world, macros are those things > found in C, high-powered assemblers, and pre-VBA Office. As such, > they do anything but keep a language small, and one encounters > multiple implementations of similar functionality

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-18 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > |>oug writes: >> Scheme has a powerful syntax extension mechanism > I did not and do not see this as relevant to the main points of my > summary above. Python has powerful extension mechanisms too, but > comparing the two languages on this basis is a

Re: File processing - is Python suitable?

2007-06-19 Thread Alan Isaac
nstructs that Python can use to process these files? Someone can. ;-) However if the file is structured, awk may be faster, since this sounds like the kind of report generation it was designed for. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-19 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > The main point of my original post was that the quoted slam at Python was > based on a misquote of Tim Peters But it wasn't based on a "misquote of Tim Peters"; it was based on an *exact* quotation of Tim Peters. > and a mischaracterization of Python

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-19 Thread Douglas Alan
Neil Cerutti <[EMAIL PROTECTED]> writes: > |>oug writes: >> Sussman's statements are not ironic because Scheme is a >> language that is designed to be extended by the end-user (even >> syntactically), while keeping the core language minimal. This >> is a rather different design philosophy from t

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-19 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Nonetheless, picking on and characterizing Tim's statement as > anti-flexibility and un-scientific is to me writing of a sort that I > would not tolerate from my middle-school child. Now it is you who are taking Sussman's comments out of context. Sussma

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-19 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Tue, 19 Jun 2007 17:46:35 -0400, Douglas Alan wrote: >> I think that most people who program in Scheme these days don't do it >> to write practical software. They either do it to have fun, or for >> academ

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > | I think you are missing the point. Sussman is making a broad > | criticism software engineering in general, as it is understood > | today. > On the contrary, I understood exactly that and said so. *My* point > is that in doing so, he made one jab at

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Tue, 19 Jun 2007 20:16:28 -0400, Douglas Alan wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> On Tue, 19 Jun 2007 17:46:35 -0400, Douglas Alan wrote: >> The problem with using Scheme for re

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Douglas Alan
asses, and that those people have created Python so I don't have > to. And I suspect that for every Douglas Alan enamored with Scheme, > there are ten thousand programmers who just want to use a handful of > pre-built tools to get the work done, never mind using macros to > cre

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: > In practice Scheme follows exactly the opposite route: there are > dozens of different and redundant object systems, module systems, > even record systems, built just by piling up feature over feature. The solution to this is to have a standard libr

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread Douglas Alan
Robert Kern <[EMAIL PROTECTED]> writes: >> The problem with Python's model is that you >> have to wait for a rather centralized process to agree on and >> implement such a feature. > No, you don't. Philip Eby has been working on various incarnations > of generic functions for some time now. The o

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-21 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 20 Jun 2007 17:23:42 -0400, Douglas Alan wrote: >> Macros are a way to abstract syntax the way that objects are used to >> abstract data types and that iterators and generators abstract control, >> etc. >

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-21 Thread Douglas Alan
Neil Cerutti <[EMAIL PROTECTED]> writes: >>> But why is the ability to abstract syntax good? >> It allows the community to develop language features in a >> modular way without having to sully the code base for the >> language itself. > That's not an advantage exclusive to macros, though. No,

cannot have test scripts in packages?

2007-06-21 Thread Alan Isaac
ser to take the step of inserting the package location into sys.path and have test.py rely on the user having done this? What is the recommended handling of demo or test scripts for a package? Thank you, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-21 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > | It allows the community to develop language features in a modular way > | without having to sully the code base for the language itself. > [etc] > Some of the strongest opposition to adding macros to Python comes > from people like Alex Martelli who h

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
Neil Cerutti <[EMAIL PROTECTED]> writes: > That said, I wouldn't give up the summer I spent studying _Simply > Scheme_. Sounds like fun. Is this like a kinder, gentler version of SICP? I'm not sure, though, that I could have learned computer science properly without the immortal characters of B

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 21 Jun 2007 15:25:37 -0400, Douglas Alan wrote: >> You are imagining something very different from what is proposed. >> Lisp-like macros don't allow "anything goes". > Provided people avoid do

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Douglas Alan" <[EMAIL PROTECTED]> wrote in message > | > But why is the ability to abstract syntax good? > | It allows the community to develop language features in a modular way > | without having

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > | But why is the ability to abstract syntax good? > I think this points to where Sussman went wrong in his footnote and > Alan in his defense thereof. Flexibility of function -- being able > to do many different thing

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Douglas Alan" <[EMAIL PROTECTED]> wrote in message > | "Terry Reedy" <[EMAIL PROTECTED]> writes: > | > I think this points to where Sussman went wrong in his footnote > | > and Al

Re: Python plain-text database or library that supports joins?

2007-06-22 Thread Alan Isaac
Not Python, but maybe relevant: http://www.scriptaworks.com/cgi-bin/wiki.sh/NoSQL/HomePage Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-23 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Nevertheless, in Python 1+2 always equals 3. You can't say the same thing > about Lisp. Well, I can't say much of *anything* about "1 + 2" in Lisp, since that's not the syntax for adding numbers in Lisp. In Lisp, numbers are typically added using the

relative import question: packaging scripts

2007-06-23 Thread Alan Isaac
test.py rely on the user having done this? Thank you, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-23 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > But if you really want declarations, you can have them. > import variables variables.declare(x=1, y=2.5, z=[1, 2, 4]) variables.x = None variables.w = 0 > Traceback (most recent call last): > File "", line 1, in > File "variabl

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-23 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: > Been there, done that. So what? Your example will not convince any > Pythonista. I'm a Pythonista, and it convinces me. > The Pythonista expects Guido to do the language job and the > application developer to do the application job. I'm happy to h

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-23 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: >> So one use for macros would be so that I can define "let" and "set" >> statements so that I might code like this: >> >> let longVariableName = 0 >> set longVarableName = foo(longVariableName) >> >> Then if longVarableName didn't already ex

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 23 Jun 2007 14:56:35 -0400, Douglas Alan wrote: > >>> How long did it take you to write the macros, and use them, compared >>> to running Pylint or Pychecker or equivalent? >> An hour? Who cares? Y

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: >> You seem oblivious to the fact that one of the huge benefits of Python >> is its elegant and readable syntax. The problem with not having a >> "flexible syntax", is that a programming language can't provide >> off-the-shelf an elegant syntax for all

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Graham Breed <[EMAIL PROTECTED]> writes: > Another way is to decorate functions with their local variables: from strict import my @my("item") > ... def f(x=1, y=2.5, z=[1,2,4]): > ... x = float(x) > ... w = float(y) > ... return [item+x-y for item in z] Well, I suppose that

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-24 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: > You should really be using pychecker (as well as Emacs autocompletion > feature ...): I *do* use Emacs's autocompletion, but sometimes these sorts of bugs creep in anyway. (E.g., sometimes I autocomplete in the wrong variable!) > ~$ pychecker -v x

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-25 Thread Douglas Alan
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> And likewise, good macro programming can solve some problems that no >> amount of linting could ever solve. > I think Lisp is more needful of macros than other langu

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-25 Thread Douglas Alan
Alexander Schmolck <[EMAIL PROTECTED]> writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >>> Python has built-in abstractions for a few container types like >>> lists and dicts, and now a new and more general one (iterators), so >>> it's the n

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-25 Thread Douglas Alan
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> I will certainly admit that Lisp programmers at the time were (and >> likely still are) much more enamored of mapping functions than of >> iterators. Mapping functi

guidance needed: best practice for script packaging

2007-06-26 Thread Alan Isaac
uestion in an unhelpful way. If my question is still unclear, I would appreciate any leads on how to clarify it. Thank you, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Douglas Alan
Paul Rubin writes: > Andy Freeman <[EMAIL PROTECTED]> writes: >> Compare that with what a programmer using Python 2.4 has to do if >> she'd like the functionality provided by 2.5's with statement. Yes, >> with is "just syntax", but it's extremely useful syntax, syntax

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Douglas Alan
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> > In the Maclisp era functions like mapcar worked on lists, and >> > generated equally long lists in memory. >> I'm aware, but there were various different

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-27 Thread Douglas Alan
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Is this where I get to call Lispers Blub programmers, because they > can't see the clear benefit to a generic iteration interface? I think you overstate your case. Lispers understand iteration interfaces perfectly well, but tend to prefer mapping fuct

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-27 Thread Douglas Alan
"Chris Mellon" <[EMAIL PROTECTED]> writes: > On 6/27/07, Douglas Alan <[EMAIL PROTECTED]> wrote: >> The C++ folks feel so strongly about this, that they refuse to provide >> "finally", and insist instead that you use destructors and RAII to do

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-27 Thread Douglas Alan
Douglas Woodrow <[EMAIL PROTECTED]> writes: > On Wed, 27 Jun 2007 01:45:44, Douglas Alan <[EMAIL PROTECTED]> wrote >>A chaque son gout > I apologise for this irrelevant interruption to the conversation, but > this isn't the first time you've written that.

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-27 Thread Douglas Alan
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > But if these "macros" are supposed to allow one to sort of extend > Python syntax, are you really going to code things like > > macrolib1.keyword > everywhere? No -- I would expect that macros (if done the way that I would like them to b

Re: guidance needed: best practice for script packaging

2007-06-28 Thread Alan Isaac
My thanks to Gabriel and Josiah. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: equality & comparison by default (was Re: Too many 'self' in python.That's a big flaw in this language.)

2007-06-28 Thread Alan Isaac
once told me. Then your math teacher misspoke. You have two different cars in the set, just as expected. Use `is`. http://docs.python.org/ref/comparisons.html This is good behavior. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-28 Thread Douglas Alan
Steve Holden <[EMAIL PROTECTED]> writes: > Douglas Woodrow wrote: >> On Wed, 27 Jun 2007 01:45:44, Douglas Alan <[EMAIL PROTECTED]> wrote >>> A chaque son gout >> I apologise for this irrelevant interruption to the conversation, >> but this isn'

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-28 Thread Douglas Alan
Steve Holden <[EMAIL PROTECTED]> writes: >> Actually, it's "chacun". And the "à" may precede the "chacun". >> |>oug > "chacun" is an elision of the two words "Chaque" (each) and "un" > (one), and use of those two words is at least equally correct, though > where it stands in modern usage I must

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-28 Thread Douglas Alan
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Obviously. But theres nothing about the with statement that's > different than using smart pointers in this regard. Sure there is -- smart pointers handle many sorts of situations, while "with" only handles the case where the lifetime of the object cor

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: >> I've written plenty of Python code that relied on destructors to >> deallocate resources, and the code always worked. > You have been lucky: No I haven't been lucky -- I just know what I'm doing. > $ cat deallocating.py > import logging > > class

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > LISP and FORTH are cousins... Not really. Their only real similarity (other than the similarities shared by most programming languages) is that they both use a form of Polish notation. |>oug -- http://mail.python.org/mailman/listinfo/python

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Hrvoje Niksic <[EMAIL PROTECTED]> writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> I think you overstate your case. Lispers understand iteration >> interfaces perfectly well, but tend to prefer mapping fuctions to >> iteration because mapping functions are

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
"Chris Mellon" <[EMAIL PROTECTED]> writes: > You're arguing against explicit resource management with the argument > that you don't need to manage resources. Can you not see how > ridiculously circular this is? No. It is insane to leave files unclosed in Java (unless you know for sure that your

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
"Chris Mellon" <[EMAIL PROTECTED]> writes: >> On the other hand, in Python, you can be 100% sure that your files >> will be closed in a timely manner without explicitly closing them, as >> long as you are safe in making certain assumptions about how your code >> will be used. Such assumptions are

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: >>On the other hand, in Python, you can be 100% sure that your files >>will be closed in a timely manner without explicitly closing them, as >>long as you are safe in making certain assumptions about how your code >>will be used. Such assumptions ar

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Hrvoje Niksic <[EMAIL PROTECTED]> writes: >> Generators aren't slower than hand-coded iterators in *Python*, but >> that's because Python is a slow language. > But then it should be slow for both generators and iterators. Python *is* slow for both generators and iterators. It's slow for *everyt

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Steve Holden <[EMAIL PROTECTED]> writes: > "Python" doesn't *have* any refcounting semantics. I'm not convinced that Python has *any* semantics at all outside of specific implementations. It has never been standardized to the rigor of your typical barely-readable language standards document. >

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Duncan Booth <[EMAIL PROTECTED]> writes: >> A precondition of much of my Python code is that callers won't >> squirrel away large numbers of tracebacks for long periods of time. I >> can live with that. Another precondition of much of my code is that >> the caller doesn't assume that it is threa

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-29 Thread Douglas Alan
Lenard Lindstrom <[EMAIL PROTECTED]> writes: > Douglas Alan wrote: >> [I]n Python, you can be 100% sure that your files >> will be closed in a timely manner without explicitly closing them, as >> long as you are safe in making certain assumptions about how your

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> But that's a library issue, not a language issue. The technology >> exists completely within Lisp to accomplish these things, and most >> Lisp programmers ev

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: >> Right. So? I understand this issue completely and I code >> accordingly. > What does it mean you 'code accordingly'? IMO the only clean way out > of this issue is to NOT rely on the garbage collector and to manage > resource deallocation explicit

<    1   2   3   4   5   6   7   8   9   10   >