datetime object from string

2006-02-06 Thread Douglas Douglas
Hi everybody. I need to create a datetime object from a string like "20/01/2005 15:10:01". I know the mxDateTime module can do this with the DateTimeFrom method, but I was wondering if is possible to do this using only the standard library. I read the datetime object reference but didn't find a m

Identifying filled circles in a scanned image

2006-03-30 Thread Douglas Douglas
Hi everybody. I have a paper form that I scan into an image. My user fills some circles in this paper form using black ink. Every form has ten rows with five circles each and the user fills only one circle for each row. I was wondering if I could use the Python Imaging Library to process these fo

Re: Identifying filled circles in a scanned image

2006-03-30 Thread Douglas Douglas
First of all. Thanks Claudio and nikie for your fast answers. What I want to do is process the forms automatically. Each circle match a letter (like in a quiz). So if the user select option A in a row, he fills the first circle. If he select option C in the next row, he fills the third circle of t

Accessing windoze file attributes

2010-09-15 Thread Douglas
found any info on how to do access/alter Windows file attributes. Please can someone direct me to a web page with suitable info (preferably with code snyppyts)? Many thanks, in advance. -- Douglas -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing windoze file attributes

2010-09-15 Thread Douglas
ise. Otherwise, don't bother. I already enough from respondents who were far more adult, knowledgeable and helpful ... and all the more impressive in comparison. Sincerely, -- Douglas -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing windoze file attributes

2010-09-16 Thread Douglas
@Dave Grateful thanks for your web site suggestions, and I will look them up. @Lawrence Pleasee accept my apologies. I mistook your brevity for a superior snotty attitude. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 and Sqlite3 - Slow

2012-08-27 Thread ian douglas
>From the sqlite documentation he quoted, it appears that ANY network filesystem, local or otherwise, should be avoided. On Aug 27, 2012 8:13 PM, wrote: > On Monday, August 27, 2012 10:32:47 PM UTC-4, Bryan wrote: > > bruceg113 wrote: > > > > > I selected sqlite for the following reasons: > > > >

Re: notmm is dead!

2012-10-28 Thread ian douglas
On 10/05/2012 12:37 PM, Prasad, Ramit wrote: I might be misunderstanding, but I think Etienne wants money in exchange for letting someone else take over. Not to stir up the hornet's nest any more, but it also sounds like now he wants money for people to license things as well: "The license fee

Re: Question regarding mod_python and a script for web.

2012-12-20 Thread ian douglas
Short answer: Use the POST method on the form instead of GET. Depending how you process the form you might need to make a few changes to the script that answers the request. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-27 Thread ian douglas
Some would argue that vim is always good enough, especially with its plugin system. I bounce between vim and Sublime Text 2, and recently bought PyCharm went it went on sale a week ago. -- http://mail.python.org/mailman/listinfo/python-list

Re: random number

2012-03-26 Thread ian douglas
On Mar 26, 2012 12:28 AM, "Steven D'Aprano" < steve+comp.lang.pyt...@pearwood.info> wrote: > > On Mon, 26 Mar 2012 08:40:00 +0200, Michael Poeltl wrote: > > > * Nikhil Verma [2012-03-26 08:09]: > A truly random six digit number will include any number between 10 > through 99. There are exa

Re: Difference between json.load() and json.loads() [From: RE: question about file handling with "with"]

2012-03-28 Thread ian douglas
On Mar 28, 2012 6:54 AM, "Nadir Sampaoli" wrote: > > Hello everyone (my first message in the mailing list), > >> >> > Is the following function correct? >> Yes, though I'd use json.load(f) instead of json.loads(). > > > The docs aren't very clear (at least for me) about the difference between json

Re: Simple SSL client hangs

2021-07-13 Thread Douglas Wells
In article <871r821wlg@hornfels.zedat.fu-berlin.de>, Loris Bennett wrote: >In Perl I have the following > > use IO::Socket::SSL; > my $my_socket = new IO::Socket::SSL(PeerAddr => 'some.server.somewhere, > PeerPort => 12345, >

Canonical way of dealing with null-separated lines?

2005-02-23 Thread Douglas Alan
Is there a canonical way of iterating over the lines of a file that are null-separated rather than newline-separated? Sure, I can implement my own iterator using read() and split(), etc., but considering that using "find -print0" is so common, it seems like there should be a more cannonical way.

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Douglas Alan
Christopher De Vries <[EMAIL PROTECTED]> writes: > I'm not sure if there is a canonical method, but I would > recommending using a generator to get something like this, where 'f' > is a file object: Thanks for the generator. It returns an extra blank line at the end when used with "find -print0"

Re: Canonical way of dealing with null-separated lines?

2005-02-25 Thread Douglas Alan
Okay, here's the definitive version (or so say I). Some good doobie please make sure it makes its way into the standard library: def fileLineIter(inputFile, newline='\n', leaveNewline=False, readSize=8192): """Like the normal file iter but you can set what string indicates newline. You can

Re: Canonical way of dealing with null-separated lines?

2005-02-26 Thread Douglas Alan
I wrote: > Okay, here's the definitive version (or so say I). Some good doobie > please make sure it makes its way into the standard library: Oops, I just realized that my previously definitive version did not handle multi-character newlines. So here is a new definition version. Oog, now my br

yield_all needed in Python

2005-02-28 Thread Douglas Alan
While writing a generator, I was just thinking how Python needs a "yield_all" statement. With the help of Google, I found a pre-existing discussion on this from a while back in the Lightweight Languages mailing list. I'll repost it here in order to improve the chances of this enhancement actually

Re: Canonical way of dealing with null-separated lines?

2005-02-28 Thread Douglas Alan
I wrote: > Oops, I just realized that my previously definitive version did not > handle multi-character newlines. So here is a new definitive > version. Oog, now my brain hurts: I dunno what I was thinking. That version sucked! Here's a version that's actually comprehensible, a fraction of th

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Andrew Dalke <[EMAIL PROTECTED]> writes: > On Mon, 28 Feb 2005 18:25:51 -0500, Douglas Alan wrote: >> While writing a generator, I was just thinking how Python needs a >> "yield_all" statement. With the help of Google, I found a >> pre-existing discus

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Cetainly, if iterator> == , I don't see how anything > is gained except for a few keystrokes. What's gained is making one's code more readable and maintainable, which is the one of the primary reasons that I use Python. |>oug -- http://mail.python.or

Re: Canonical way of dealing with null-separated lines?

2005-03-01 Thread Douglas Alan
"John Machin" <[EMAIL PROTECTED]> writes: >>lines = (partialLine + charsJustRead).split(newline) > The above line is prepending a short string to what will typically be a > whole buffer full. There's gotta be a better way to do it. If there is, I'm all ears. In a previous post I provide

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Duncan Booth <[EMAIL PROTECTED]> writes: > Douglas Alan wrote: >> "Terry Reedy" <[EMAIL PROTECTED]> writes: >>> Cetainly, if >> iterator> == , I don't see how anything >>> is gained except for a few keystrokes. >> What'

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Francis Girard <[EMAIL PROTECTED]> writes: > Therefore, the suggestion you make, or something similar, would have > actually ease my learning, at least for me. Yes, I agree 100%. Not having something like "yield_all" hurt my ability to learn to use Python's generators quickly because I figured t

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
David Eppstein <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Douglas Alan <[EMAIL PROTECTED]> wrote: >> > Cetainly, if > > iterator> == , I don't see how anything >> > is gained except for a few keystrokes. >> Wha

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Steve Holden <[EMAIL PROTECTED]> writes: > Guido has generally observed a parsimony about the introduction of > features such as the one you suggest into Python, and in particular > he is reluctant to add new keywords - even in cases like decorators > that cried out for a keyword rather than the u

Re: Canonical way of dealing with null-separated lines?

2005-03-01 Thread Douglas Alan
"John Machin" <[EMAIL PROTECTED]> writes: >> In Python, >>longString + "" is longString >> evaluates to True. I don't know how you can do nothing more >> gracefully than that. > And also "" + longString is longString > The string + operator provides those graceful *external* results by >

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Steven Bethard <[EMAIL PROTECTED]> writes: > I'm guessing the * syntax is pretty unlikely to win Guido's > approval. There have been a number of requests[1][2][3] for syntax > like: > x, y, *rest = iterable Oh, it is so wrong that Guido objects to the above. Python needs fully destructurin

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Isaac To <[EMAIL PROTECTED]> writes: >> "Isaac" == Isaac To <[EMAIL PROTECTED]> writes: > > def gen_all(gen): > for e in gen: > yield e > > def foogen(arg1): > def foogen1(arg2): > # Some code here > # Some code here > gen_all(arg3) > ^ I mean foogen

Re: yield_all needed in Python

2005-03-02 Thread Douglas Alan
Nick Coghlan <[EMAIL PROTECTED]> writes: > If you do write a PEP, try to get genexp syntax supported by the > yield keyword. > That is, the following currently triggers a syntax error: >def f(): > yield x for x in gen1(arg) Wouldn't yield *(x for x in gen1(arg)) be sufficient, and

Re: Editor for Python

2014-01-08 Thread Douglas Duhaime
recipient, please notify > the sender immediately and do not disclose the contents to any other > person, use it for any purpose, or store or copy the information in any > medium. Thank you. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Douglas Duhaime Department of English, University of Notre Dame douglasduhaime.com, dduha...@nd.edu -- https://mail.python.org/mailman/listinfo/python-list

Dynamic Import with sub module

2015-05-23 Thread Douglas Garstang
All, Can someone tell me how the following statement: import slice_fablib_common.common as common would be replicated with __import__ or import_module? I'm using fabric and I want the module when imported to appear in the namespace (which fabric shows as a task), in this case, as 'common.chef'.

Re: Dynamic Import with sub module

2015-05-23 Thread Douglas Garstang
ub-modules from common. I'm essentially loading the entire package here because I need to put an import for every sub module into __init__.py anyway. :( Doug. On Sat, May 23, 2015 at 9:03 AM, Douglas Garstang wrote: > All, > > Can someone tell me how the following statement: > >

Re: Doing a HTTP DELETE operation with urllib2?

2011-12-30 Thread Douglas Landgraf
es heavy use of HTTPCookieProcessor. If I need to use the httplib calls directly, I'll have to re-implement a lot of that machinery. You might want to look: https://github.com/dougsland/rhev3-restapi-scripts/blob/master/sample-delete.py -- Cheers Douglas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread ian douglas
On 03/04/2013 11:06 AM, io wrote: esclusioni_file = open('/home/io/btc_trading/exclusions.txt','r') Windows error : Traceback (most recent call last): File "C:\btc_trading\scripts \import_json_2_csv_from_web_and_exclusions.py", line 10, in f = open("/home/io/btc_trading/markets.csv","w

Re: Insert comma in number?

2013-03-06 Thread ian douglas
On 03/06/2013 03:39 PM, eli m wrote: I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of 1000 it would say 1,000 pip install humanize import humanize my_int

Re: MySQLdb not updating rows

2006-06-28 Thread Douglas Andrade
Hello Simon,Take a look at this link: http://python.codezoo.com/pub/component/3583 May autocommit (or commit, as Fredrik pointed out) be the solution.On 28 Jun 2006 06:46:54 -0700, Bowen <[EMAIL PROTECTED] > wrote:Thanks for that, it appears it was the db.commit() that sorted itout.lesson learn

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: c[:]()

2007-05-31 Thread Douglas Woodrow
; > >> > >> >(typo correction for other easily-confused newbies like myself) >> > >> >I think you mean [...] >Hey Douglas, > >Perhaps I was being too abstract? Here goes: > >,--- >| def selector(): >|

Re: c[:]()

2007-06-01 Thread Douglas Woodrow
On Thu, 31 May 2007 18:42:05, Warren Stringer <[EMAIL PROTECTED]> wrote >They were copied from working code. Copied *badly*? Yes. Running python via: > Windows -> start -> run -> python >doesn't allow cut and paste Hi Warren, Actually you can copy and paste from a Windows cmd/command shell: ri

Re: c[:]()

2007-06-01 Thread Douglas Woodrow
On Fri, 1 Jun 2007 07:23:16, Steve Holden <[EMAIL PROTECTED]> wrote >> Actually you can copy and paste from a Windows cmd/command shell: >>right-click the title-bar of the window, select "Edit" from the pop-up >>menu, then "Mark" from the sub-menu to copy whatever you want to >>select into the

Re: int vs long

2007-06-04 Thread Douglas Woodrow
On Mon, 4 Jun 2007 10:50:14, Peter Otten <[EMAIL PROTECTED]> wrote >>> >>> This is fixed in Python2.5: >>> >> Hm, my test above was from 2.5!? > >Then your installation is broken. What does > import itertools itertools >'/usr/local/lib/python2.5/lib-dynload/itertools.so'> > >print? Mayb

Re: Strange behavior in Windows

2007-06-05 Thread Douglas Woodrow
On Mon, 4 Jun 2007 21:34:36, David Stockwell wxp <[EMAIL PROTECTED]> wrote > >in DOS you can try this to see what your path is: > >echo "My path is %PATH%" or more simply: , | C:> path ` -- Doug Woodrow -- http://mail.python.org/mailman/listinfo/python-list

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: Convert to C/C++?

2007-06-14 Thread Douglas Wells
self.timestamp, self.time_low, self.time_mid, > self.time_hi_version > #print 'clock_seq ', self.clock_seq, self.clock_seq_low, > self.clock_seq_hi_variant > > vs unix gettimeofday > > int gettimeofday(struct timeval *tp, struct timezone *tzp); By the way, the UNIX

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: 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
Steven D'Aprano <[EMAIL PROTECTED]> writes: > All of which makes Douglas Alan's accusations of Not Invented Here > syndrome about Python seem rather silly. I've never made such an accusation about Python itself -- just about the apparent attitude of some pontiffs

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,

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 things -- is quite different from flexib

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'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

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

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 Woodrow
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. The word "chaque" is not a pronoun. http://grammaire.r

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: 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

  1   2   3   >