Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bengt Richter) wrote: > >Did you mean type(x).__getitem__(x,y)? > > > Not if x is a classmethod, Oh yeah, right. Duh! > >And where is this documented? > Between the lines in my previous post ;-) I see. I guess I wasn't asking a stupid questi

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > What I'm really trying to do is to create enumerated types such that if: > > > > e1 = enum(lst) and v = e1(x) > > > > then > > > >

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bengt Richter) wrote: > On Mon, 14 Mar 2005 23:44:46 -0700, Steven Bethard <[EMAIL PROTECTED]> > wrote: > > >Ron Garret wrote: > >> What I'm really trying to do is to create enumerated types such that i

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Yeah, except I actually left out one thing: I also want type(v)==e1. > > Why? In Python usually you rely on duck-typing and not explicit type > checks. What is it that you're trying to gain by asserting type(v) ==

Re: __getitem__ method on (meta)classes

2005-03-16 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > In article <[EMAIL PROTECTED]>, > > Steven Bethard <[EMAIL PROTECTED]> wrote: > > > >>>Yeah, except I actually left out one thing: I al

Re: Time for : comp.lang.python.newbies ??

2004-12-07 Thread Ron Phillips
ies list or the knowbies list.   Maybe just ask us to post *everything* to the .tutor list and let the question bubble up to this list if it doesn't get answered there? Or ask us to post to the .tutor list until we've responded to someone else's post a few times (proven ourselve

[jobs] Python web programmer needed (Los Angeles)

2004-12-11 Thread Ron Garret
Python programmer needed to do web development for an early-stage entertainment industry startup company. We prefer someone in the northern LA area (the company offices are in Altadena), but will consider telecommuters. Please email resumes to me at ron at flownet.com. rg -- http

PIL and format conversions -- Noobie.

2004-12-14 Thread Ron Phillips
gif, and it got even bigger (6 - 8 x) -- am I using PIL wrong, or is PIL the wrong tool? If so, how should I use PIL so it best compresses the outfile? Or, what tool should I use?   Ron  -- http://mail.python.org/mailman/listinfo/python-list

Specifying __slots__ in a dynamically generated type

2005-03-27 Thread Ron Garret
I need to dynamically generate new types at run time. I can do this in two ways. I can use the "type" constructor, or I can generate a "class" statement as a string and feed that to the exec function. The former technique is much cleaner all else being equal, but I want to be able to specif

Re: Specifying __slots__ in a dynamically generated type

2005-03-27 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > I need to dynamically generate new types at run time. I can do this in > > two ways. I can use the "type" constructor, or I can generate a "class"

Re: Specifying __slots__ in a dynamically generated type

2005-03-27 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > I need to dynamically generate new types at run time. I can do this in > > two ways. I can use the "type" constructor, or I can generate a "class"

Weakrefs to classes that derive from str

2005-03-29 Thread Ron Garret
Why doesn't this work? >>> from weakref import ref >>> class C(str): pass ... >>> ref(C()) Traceback (most recent call last): File "", line 1, in ? TypeError: cannot create weak reference to 'C' object >>> Note that this does work: >>> class D(int): pass ... >>> ref(D()) >>> Likewise for

Re: Weakrefs to classes that derive from str

2005-03-29 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > Why doesn't this work? > > > >>>>from weakref import ref > >>>>class C(str): pass > > ... > >>>>ref(C()) >

Re: Weakrefs to classes that derive from str

2005-03-30 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > Steven Bethard wrote: > > Ron Garret wrote: > >> None of the native types (int, float, list, tuple, etc.) can have weak > >> references, but wrapping them in a class is supposed

Re: Weakrefs to classes that derive from str

2005-03-30 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > >>>>foo(int) > >>>>foo(float) > >>>>foo(dict) > >>>>foo(list) > >>>>foo(str) > > TypeError: cannot create

Re: Weakrefs to classes that derive from str

2005-03-30 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > [Ron Garret] > > Why doesn't this work? > > > > >>> from weakref import ref > > >>> class C(str): pass > > ... > > >>&

Re: Weakrefs to classes that derive from str

2005-03-30 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > [Ron Garret] > > Thanks for the detailed explanation. I understand now why you can't > > create weakrefs to these types. What I don't understand still is why > &

Re: Can'r run BLT twice?

2005-04-29 Thread Ron Adam
did to solve it. :-( It is fixable though. I know that's not much help. I'll look at how I use it in my program and see if that rings any bells. Ron Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Can'r run BLT twice?

2005-04-29 Thread Ron Adam
ly using the free version of EditPad Pro, the full version has a spelling checker built in. It's loads up fast and can run external programs on the current document and capture the results and the errors in separate panels. It also supports syntax highlighting for pthon (and a dozen other languages). Cheers, Ron Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python - block grouping (spaces)

2015-04-16 Thread Ron Adam
anguage designers preference at that time. But still, I think the whole braces are good/evil is over stated. There are lots of more important things in languages to consider. Cheers, Ron -- https://mail.python.org/mailman/listinfo/python-list

Re: Great Math Mystery

2015-04-17 Thread Ron Adam
by people in safe conditions. Percentage of incorrect judgements of people in dangerous conditions. Percentage of incorrect judgements of people in safe, but perceived dangerousness conditions.. etc... Would be possible to calculate a norm or average from that kind of info? It

Re: New to Python - block grouping (spaces)

2015-04-19 Thread Ron Adam
needed is already in a text editor. The token file format becomes the bridge that spans the gap between the user/editor and the compiler/interpreter. Then your compiler/interpreter is all implementation details that work on a single standardised token file format rather than unforma

An experiment with blocks of object code and other meta ideas.

2015-04-27 Thread Ron Adam
ome form. Possibly as a script language that can be used in projects. There is lots of opportunities to make improvements and additions as there are zero users currently. It's still very early in it's development, so don't expect too much at this time. Cheers, Ron -- https://mail.python.org/mailman/listinfo/python-list

Re: Rule of order for dot operators?

2015-05-18 Thread Ron Adam
z is resolved in y's scope. Which is why you can implement objects with closures, but you need to delay name resolution to do that. Which is what the "." does. Pythons attribute lookup is a bit more complex than this of course. https://docs.python.org/3.4/howto/descriptor.h

Re: Rule of order for dot operators?

2015-05-19 Thread Ron Adam
On 05/19/2015 02:25 AM, Chris Angelico wrote: On Tue, May 19, 2015 at 12:43 PM, Ron Adam wrote: >Having just implementing something similar for nested scopes, it turns out >it can't be operators because if it was, then the names y and z would be >resolved in the wrong scope.

Re: Set a flag on the function or a global?

2015-06-15 Thread Ron Adam
his is interactive, I'd advise going for the absolute simplest, which this would be. Go for the function attribute IMO. Another way is to make it an object with a __call__ method. The the attribute can be accessed from both outside and inside dependably. Cheers, Ron -- https://mail.python.org/mailman/listinfo/python-list

Re: Set a flag on the function or a global?

2015-06-16 Thread Ron Adam
On 06/16/2015 05:15 AM, Steven D'Aprano wrote: On Tuesday 16 June 2015 10:24, Ron Adam wrote: >Another way is to make it an object with a __call__ method. > >The the attribute can be accessed from both outside and inside dependably. That's what functions are, objects wit

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-21 Thread Ron Adam
mutated would be a good initial step. Have it turned off by default. I think it will be needed to test how any of the above is working. It may also allow some multiprocessing just by avoiding raising any MutatedObject exceptions. Cheers, Ron -- https://mail.python.org/mailman/listinfo/python-list

Re: (side-)effects and ...

2015-07-05 Thread Ron Adam
expressions? Variables that are changed from an outside environment are "Volatile". https://en.wikipedia.org/wiki/Volatile_%28computer_programming%29 It isn't used in python, though I think maybe it should be. Cheers, Ron -- https://mail.python.org/mailman/listinfo/python-list

RE: "0 in [True,False]" returns True

2005-12-13 Thread Ron Griswold
ue >>> Booltype.__class__ == var.__class__ False Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Python newbie needs help

2005-12-14 Thread Ron Hudson
First let me apologize if this post offends, I am a real newbie to Python having only used it for about 2 days. If this is the wrong place to post newbie questions, please be polite. I have the O'Reily Learning Python book and I am reading it. Here's what I am working on.. I am trying to cre

Re: Regex anomaly

2006-01-03 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > "Sam Pointon" <[EMAIL PROTECTED]> wrote: > > > Would this particular inconsistency be candidate for change in Py3k? > > Seems to me the pos and endpos arguments are redundant with slicing, >

RE: how to improve this simple block of code

2006-01-11 Thread Ron Griswold
How 'bout: X = "132.00"; Y = int(float(X)); Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mel Wilson Sent: Wednesday, January 11, 2006 1:08 PM To: python-list@python.org Subj

RE: Converting a string to an array?

2006-01-12 Thread Ron Griswold
Does this do what you are looking for? >>> s = 'abcdefg'; >>> a = []; >>> a += s; >>> a; ['a', 'b', 'c', 'd', 'e', 'f', 'g'] Ron Griswold Character TD R!OT Pictures [EMAIL P

Creating shortcuts?

2006-01-12 Thread Ron Griswold
Hi Folks, Is it possible to create a shortcut to a file in Python? I need to do this in both win32 and OSX. I've already got it covered in Linux by system(ln...). Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Creating shortcuts?

2006-01-13 Thread Ron Griswold
appear in a windows directory listing, not that I really want it to. As for os.link and os.symlink, these appear to be unix specific. It would be nice if os.symlink, when run on windows, would create a shortcut. Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message

RE: Creating shortcuts?

2006-01-13 Thread Ron Griswold
Hi Roger, Thank you, I will look into this. Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roger Upole Sent: Friday, January 13, 2006 4:59 AM To: python-list@python.org Subject: Re: Creating

Restarting scripts

2006-01-16 Thread Ron Griswold
with python code, or third party software, I’d love to hear about it.   Thanks,   Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED]   -- http://mail.python.org/mailman/listinfo/python-list

RE: Restarting scripts

2006-01-16 Thread Ron Griswold
aying that the socket the server is opening is already in use (even on the first try). Does anyone know of a nice reliable app that already does this for you? Open source preferably. Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [ma

HTML library

2006-01-17 Thread Ron Griswold
go the other way ;)   Thanks,   Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED]   -- http://mail.python.org/mailman/listinfo/python-list

RE: HTML library

2006-01-17 Thread Ron Griswold
Hi Cliff, Looks like xist is exactly what I'm looking for. Thank you, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: Cliff Wells [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 17, 2006 9:33 AM To: Ron Griswold Cc: python-list@python.org Su

cgi script error

2006-01-19 Thread Ron Griswold
HTML();     It gives the same complaint if I’ve got openDocument and/or openHead uncommented. The script is executing otherwise the error wouldn’t show up in the error_log with specific text from the script. Also, I’ve run the script and redirected it’s output to an .html file and the server loads it with no problems.   Any ideas are appreciated.   Thanks,   Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED]   -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest Way To Loop Through Every Pixel

2006-07-29 Thread Ron Adam
ed to look at an image library that uses compiled C (or assembly) code to do the brute force work. It may also be possible to access your platforms directX or opengl library routines directly to do it. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: String.digits help!!!

2006-08-09 Thread Ron Adam
ctions. It probably should be an attribute of the class. These are just guide lines of course, but by keeping them in mind, I do think it has helped me to abstain from writing cluttered class's. Maybe there are other guidelines like these that are helpful? Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Easy Validators

2006-08-20 Thread Ron Adam
xamples at the end) Cheers, Ron # - Some Simple Validators. def Any(arg): pass def IsNumber(arg): assert type(arg) in (int, long, float), \ "%r is not a number" % arg def IsInt(arg): assert type(arg) in (int, long), \ "%r

Re: Painless way to do 3D visualization

2006-10-08 Thread Ron Adam
Peter Beattie wrote: > Hey folks, > > I need to do the following relatively simple 3D programming: > > I want to convert data from four-item tuples into 3D co-ordinates in a > regular tetrahedron. Co-ordinates come in sequences of 10 to 20, and the > individual dots in the tetrahedron need to be

Re: 3D Vector Type Line-Drawing Program

2006-10-10 Thread Ron Adam
way to have the display show a wire frame image instead of shaded shapes? And with or without hidden line removal? Is there an easy way to convert a display to something that can be printed? Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: 3D Vector Type Line-Drawing Program

2006-10-12 Thread Ron Adam
Scott David Daniels wrote: > Ron Adam wrote: >> Scott David Daniels wrote: >>> James Stroud wrote: >>>>> I'm looking for a program to do line-drawings in 3d, with output to >>>>> postscript or svg or pdf, etc. I would like to describe a scene

Alphabetical sorts

2006-10-16 Thread Ron Adam
I have several applications where I want to sort lists in alphabetical order. Most examples of sorting usually sort on the ord() order of the character set as an approximation. But that is not always what you want. The solution of converting everything to lowercase or uppercase is closer, but

Re: Alphabetical sorts

2006-10-16 Thread Ron Adam
Neil Cerutti wrote: > On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote: >> I have several applications where I want to sort lists in >> alphabetical order. Most examples of sorting usually sort on >> the ord() order of the character set as an approximation. But >

Re: Alphabetical sorts

2006-10-17 Thread Ron Adam
Neil Cerutti wrote: > On 2006-10-17, Ron Adam <[EMAIL PROTECTED]> wrote: >> Neil Cerutti wrote: >>> On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote: >>>> I have several applications where I want to sort lists in >>>> alphabetical order.

Re: Need a strange sort method...

2006-10-17 Thread Ron Adam
sequence as a list. """ def iterinner(seq): for s in seq: if hasattr(s, '__iter__'): for i in iterinner(s): yield i else: yield s return list(iterinner(sequence)) Cheers, Ron Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a strange sort method...

2006-10-17 Thread Ron Adam
Ron Adam wrote: > Neil Cerutti wrote: >> On 2006-10-16, Tim Chase <[EMAIL PROTECTED]> wrote: >>> If you need it in a flat list, rather than as a list of >>> chunk_size lists (which are handy for iterating over in many >>> cases), there are ways of obtain

Flexable Collating (feedback please)

2006-10-17 Thread Ron Adam
ed this in *anything* yet, so don't plug it into production code of any type. I also haven't done any performance testing. See the doc tests below for examples of how it's used. Cheers, Ron Adam """ Collate.py A general purpose configurable collate

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
always find a few obvious glitches right after I post something. ;-) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] a little about regex

2006-10-18 Thread Ron Adam
hem in the correct order) That way it will skip the more general filter and not increment cnt twice. It's not exactly clear on what output you are seeking. If you want 0 for not filtered and 1 for filtered, then look to Freds Hint. Or are you writing a test at the moment, a

Re: How to convert this list to string?

2006-10-18 Thread Ron Adam
anks Just to be different from the other suggestions... >>> a = [1, 2, 3] >>> str(a[1:]).strip('[]').replace(',', '') '2 3' By the way. It's a good idea to try not to use 'list' or other built-in names for your own objects. Best to start with good habits so that you avoid odd hard to find bugs later. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
[EMAIL PROTECTED] wrote: > > On Oct 18, 2:42 am, Ron Adam <[EMAIL PROTECTED]> wrote: >> I put together the following module today and would like some feedback on any >> obvious problems. Or even opinions of weather or not it is a good approach. > ,,, >

Re: Flexible Collating (feedback please)

2006-10-18 Thread Ron Adam
rings and tests were made. Any feedback is welcome. Cheers, Ron """ Collate.py A general purpose configurable collate module. Collation can be modified with the following keywords: CAPS_FIRST -> Aaa, aaa, Bbb, bbb HYPHEN_AS

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
ntage of the list is it can be iterated without splitting first. But that's a minor thing. self.options = options.lower().split(' ') fixes that easily. Once I'm sure it's not going to get any major changes I'll post this as a recipe. I think it's almost ther

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
This is how I changed it... (I edited out the test and imports for posting here.) locale.setlocale(locale.LC_ALL, '') # use current locale settings class Collate(object): """ A general purpose and configurable collator class. """ options = [ 'CAPS_FIRST', 'NUMERICAL', 'HYPHEN

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
Gabriel Genellina wrote: > At Wednesday 18/10/2006 03:42, Ron Adam wrote: > >> I put together the following module today and would like some feedback >> on any >> obvious problems. Or even opinions of weather or not it is a good >> approach. >>

Re: Flexible Collating (feedback please)

2006-10-19 Thread Ron Adam
Leo Kislov wrote: > Ron Adam wrote: > >> locale.setlocale(locale.LC_ALL, '') # use current locale settings > > It's not current locale settings, it's user's locale settings. > Application can actually use something else and you will overwrite &g

Re: Flexible Collating (feedback please)

2006-10-19 Thread Ron Adam
[EMAIL PROTECTED] wrote: > Ron Adam: > > Insted of: > > def __init__(self, flags=[]): > self.flags = flags > self.numrex = re.compile(r'([\d\.]*|\D*)', re.LOCALE) > self.txtable = [] > if HYPHEN_AS_SPACE in flag

Re: Flexable Collating (feedback please)

2006-10-19 Thread Ron Adam
Gabriel Genellina wrote: > At Wednesday 18/10/2006 21:36, Ron Adam wrote: >> Maybe changing the CAPS_FIRST to REVERSE_CAPS_ORDER would do? > > At least it's a more accurate name. > There is an indirect way: test locale.strcoll("A","a") and see

Re: [OT] a little about regex

2006-10-19 Thread Ron Adam
Fulvio wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Wednesday 18 October 2006 15:32, Ron Adam wrote: > >> |Instead of using two separate if's, Use an if - elif and be sure to test > > T

Re: invert or reverse a string... warning this is a rant

2006-10-19 Thread Ron Adam
>>> reverser = slice(None, None, -1) >>> >>> 'abcdefg'[reverser] 'gfedcba' Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Flexible Collating (feedback please)

2006-10-20 Thread Ron Adam
Leo Kislov wrote: > Ron Adam wrote: >> Leo Kislov wrote: >>> Ron Adam wrote: >>> >>>> locale.setlocale(locale.LC_ALL, '') # use current locale settings >>> It's not current locale settings, it's user's locale setting

Re: invert or reverse a string... warning this is a rant

2006-10-21 Thread Ron Adam
to account some newer 2.5 features and the tests will need to be updated so they retrieve dis's output instead of redirecting stdout. If you'd like to finish it up and submit it as a patch, I can forward it to you. It would be good to have a second set of eyes look at it also. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: invert or reverse a string... warning this is a rant

2006-10-21 Thread Ron Adam
Steven D'Aprano wrote: > On Sat, 21 Oct 2006 01:58:33 -0500, Ron Adam wrote: > >> [You said from an earlier post...] >> >>> (That's a complaint I have about the dis module -- it prints its results, >>> instead of returning them as a string. That makes

Why doesn't this work?

2006-10-21 Thread Ron Garret
Python 2.3.5 (#1, Jan 30 2006, 13:30:29) [GCC 3.3 20030304 (Apple Computer, Inc. build 1819)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from datetime import datetime >>> class ts(datetime): ... def __init__(self): pass ... >>> ts() Traceback (most rece

Re: Why doesn't this work?

2006-10-21 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: > Because datetime is a new-style class: Ah. > The Constructor __new__ > > If you are like me, then you probably always thought of the __init__ method > as > the Python equivalent of what is called a constructor in C++. Th

Re: PSF Infrastructure has chosen Roundup as the issue tracker for Python development

2006-10-22 Thread Ron Adam
t. This is probably the more common situation. But not as common as the viewpoint you've stated above unfortunately. Cheers, Ron > Never thought having a small philosophical conversion with Margaret > Mead beyond time and space. So many thanks to great Google and its > devotees. > > Kay -- http://mail.python.org/mailman/listinfo/python-list

Collate Module

2006-10-23 Thread Ron Adam
ll be appreciated. Any minor improvements to wording, spelling, etc.. are also welcome. Many thanks for all the terrific feed back and suggestions! Cheers, Ron ---start--- """ Collate.py - Sorts lists of strings in various ways depending options and locale.

Re: Style for modules with lots of constants

2006-11-01 Thread Ron Adam
rted or initialized. It avoids having to type namespace prefixes such as thismod.textmode, or myclass.textmode or importing a bunch of values into global name space. Strings comparisons in python are very fast. The disadvantage is an invalid flag may pass silently unless you do some sort of validation which may slow things down a bit. Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
re reliable python parser means development time can be spent improving the language in other areas instead of fixing parsing problems every time a new feature is added that might be used in a conditional expression. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> The faq also pointed out a technical reason for requiring the colon. It >> makes >> the underlying parser much easier to write and maintain. This shouldn't be >> taken to lightly in my opinion, because a simpler easer t

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> It is also an outline form that frequently used in written languages. >> Something >> python tries to do, is to be readable as if it were written in plain >> language >> where it is practical to do so. So the c

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
t; x == blue or x == red or x == yellow Maybe it should have been expressed as: x == (blue or red or yellow) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Paul Boddie wrote: > Ron Adam wrote: >> PS. Rather than shav of on character her and ther in pythons programing >> languag, Lets remov all the silent leters from the english languag. That will >> sav thousands mor kestroks over a few yers. > > How about changing Pyt

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
Steven D'Aprano wrote: > On Sat, 11 Nov 2006 01:13:03 -0600, Ron Adam wrote: > >> Steven D'Aprano wrote: >>> On Fri, 10 Nov 2006 21:24:50 +0100, Bjoern Schliessmann wrote: >>> >>>> Marc 'BlackJack' Rintsch wrote: >>>> >&

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
Georg Brandl wrote: > Ron Adam wrote: >> Michael Hobbs wrote: >> >>> The same problem that is solved by not having to type parens around the >>> 'if' conditional, a la C and its derivatives. That is, it's unnecessary >>> typing to

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
Georg Brandl wrote: > Ron Adam wrote: >> Georg Brandl wrote: >>> Ron Adam wrote: >>>> Michael Hobbs wrote: >>>> >>>>> The same problem that is solved by not having to type parens around the >>>>> 'if' condition

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
>>> A bit of a circular answer. > >>> > >>> Why the rule? -> So not to break the rule? > >> > >> You proposed to allow leaving off line continuation '\' only in the > >> "if", "for&qu

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> LOL, of course it would. I would expect that too after a suitable amount >> of >> 'brain washing', oops, I mean training and conditioning. ;-) >> > Trust me, my brain is quite filthy and doesn't wash ea

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> [EMAIL PROTECTED] wrote: >> >>> >>>>> I'm not sure why '\'s are required to do multi-line before the >>> colon. >>> >>>> Special cases aren't special en

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> Michael Hobbs wrote: >> >>> Ron Adam wrote: >>> >>>> LOL, of course it would. I would expect that too after a suitable amount >>>> of >>>> 'brain washing', oops, I

Re: Py3K idea: why not drop the colon?

2006-11-16 Thread Ron Adam
o change anything as it is an effort to explore and understand why things where made the way they are. To those who already know, this seems silly, but to those who are still learning, it seems important. This could be broken down a bit more, but then we would get into long debates o

Re: Python 411.

2006-06-13 Thread Ron Stephens
Steve, thanks for the note. The name Python411 comes from me copying my good friend Rob Walch, who named his podcast Podcast411, which is a popular show on which he interviews other podcasters like Adam Curry etc. He also has a book just published about podcasting. Ron Stephens -- http

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Marshall" <[EMAIL PROTECTED]> wrote: > The conversation I would *really* like to have is the one where we > discuss what all the differences are, functionally, between the two, > and what the implications of those differences are, without trying > to address which

Parsing form input in a BaseHTTPServer

2006-09-01 Thread Ron Garret
I'm write a web server using BaseHTTPServer. It can't be a CGI because it has to do some weird server-push stuff as database updates come in. But I still need to process form inputs as if it were a CGI. But the cgi module only works in a CGI environment. Is there something with the equivale

Re: OO on python real life tutorial?

2006-09-02 Thread Ron Adam
and not a simulation where you would use OO to actually model the objects which can also work, but is much harder to do. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
I'm trying to figure out how to use BaseHTTPServer. Here's my little test app: = #!/usr/bin/python from BaseHTTPServer import * import cgi class myHandler(BaseHTTPRequestHandler): def do_GET(r): s = '' try: s = cgi.parse_qs(r.rfile.read(int(r.

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > The normal way is > > s = cgi.parse() > > since the CGI script sees the client network socket (after consumption > of HTTP headers) as its standard input. Doesn't work. (I even tried sys.stdin=r.rfile; s=cgi.parse())

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > But basically, you aren't providing a CGI environment, and that's why > cgi.parse() isn't working. Clearly. So what should I be doing? Surely I'm not the first person to have this problem? I have managed to work aroun

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > In article <[EMAIL PROTECTED]>, > > Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > >>But basically, you aren't providing

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > Ron Garret wrote: > >> In article <[EMAIL PROTECTED]>, > >> Steve Holden <[EMAIL PROTECTED]> wrote: > >> > >> > &

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Damjan <[EMAIL PROTECTED]> wrote: > >> But basically, you aren't providing a CGI environment, and that's why > >> cgi.parse() isn't working. > > > > Clearly. So what should I be doing? > > Probably you'll need to read the source of cgi.parse_qs (like Steve did)

Re: BaseHTTPServer weirdness

2006-09-12 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > I wouldn't necessarily say you are wrong here, It's just that the cgi > module has sort of "just growed", so it isn't conveniently factyored for > reusability in other contexts. Several people (including me) have taken >

Re: Decimal() instead of float?

2006-11-17 Thread Ron Adam
ng into account the larger error, by rounding your results to a proper number of significant digits, then you may have a much bigger problem, and a much larger real error than you realize. So, you first need to manage the errors introduced when the data is created. By doing that, you will proba

<    1   2   3   4   5   6   7   8   >