will 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.
Class: Collate(option_string
they succeed.
There is also the view point of informal groups of individuals working
separately but having a significant combined effect. This is probably the more
common situation.
But not as common as the viewpoint you've stated above unfortunately.
Cheers,
Ron
Never thought having
, 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
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 it hard to capture the
output for further analysis.)
I
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 recent call last):
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++. This isn't
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 settings.
Application can actually use something else and you will overwrite
that. You can also affect
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
that. You can also affect (unexpectedly to the application
[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 flags:
self.txtable.append
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 how they
get sorted. Then define options CAPS_FIRST
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
Thank you, Ron, for the input :)
I'll examine also
'[reverser]
'gfedcba'
Ron
--
http://mail.python.org/mailman/listinfo/python-list
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 module.
Collation can be modified
always find a few obvious glitches right after I post something. ;-)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
you know your filters are working as designed?
Another approach would be to assign values for filtered, accepted, and
undefined
and set those accordingly instead of incrementing and decrementing a counter.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
'
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
[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.
,,,
def __call__(self, a, b):
This allows
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_SPACE - Don't ignore
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 there.
Cheers and thanks,
Ron
[EMAIL
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',
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.
if self.flag CAPS_FIRST:
s
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. Most examples of sorting usually sort on
the ord() order of the character
:
yield s
return list(iterinner(sequence))
Cheers,
Ron Adam
--
http://mail.python.org/mailman/listinfo/python-list
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 obtaining it, such as the hackish
sum([a[i::chunk_size] for i
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,
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
that is not always what you want.
Check
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
with certain 1-3d elements oriented in 3d space with dashed
? 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
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
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
a look
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 =
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()) Don't
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 around
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 a CGI environment, and that's why
cgi.parse() isn't working.
Clearly. So what
In article [EMAIL PROTECTED],
Kent Johnson [EMAIL PROTECTED] wrote:
Steve Holden wrote:
Ron Garret wrote:
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
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) and
see what
work, but is much harder to do.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
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
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 is not an Int % arg
def IsFloat
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
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
vim or emacs)
As some suggested, as a beginner you don't need much of a super
powered IDE. If I wasn't using IDLE, I'd be using vim or gvim.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
of How to Think Like a Computer
Scientist:
http://www.ibiblio.org/obp/thinkCSpy/
And Dive into Python (available online as well as paper):
http://diveintopython.org/
Hope this helps.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
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 approach
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
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I'm using an OS X terminal to ssh to a Linux machine.
In theory it should work out of the box. OS X terminal should set
enviromental variable LANG=en_US.utf-8, then ssh should transfer
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I'm using an OS X terminal to ssh to a Linux machine.
In theory it should work out of the box. OS X
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Serge Orlov wrote:
Ron Garret wrote:
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I'm using an OS X terminal to ssh to a Linux machine.
In theory
u'\xbd'
u'\xbd'
print _
Traceback (most recent call last):
File stdin, line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
position 0: ordinal not in range(128)
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
Fredrik Lundh [EMAIL PROTECTED] wrote:
Ron Garret wrote:
u'\xbd'
u'\xbd'
print _
Traceback (most recent call last):
File stdin, line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
position 0: ordinal not in range(128
In article [EMAIL PROTECTED],
Robert Kern [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I forgot to mention:
sys.getdefaultencoding()
'utf-8'
A) You shouldn't be able to do that.
What can I say? I can.
B) Don't do that.
OK. What should I do instead?
C) It's not relevant
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
In article [EMAIL PROTECTED],
Robert Kern [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I forgot to mention:
sys.getdefaultencoding()
'utf-8'
A) You shouldn't be able to do
In article [EMAIL PROTECTED],
Robert Kern [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I'm using an OS X terminal to ssh to a Linux machine.
Click on the Terminal menu, then Window Settings Choose Display
from
the combobox. At the bottom you will see a combobox title Character Set
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
In article [EMAIL PROTECTED],
Serge Orlov [EMAIL PROTECTED] wrote:
Ron Garret wrote:
In article [EMAIL PROTECTED],
Robert Kern [EMAIL PROTECTED] wrote:
Ron Garret wrote:
I
Alex Martelli wrote:
Ron Adam [EMAIL PROTECTED] wrote:
...
I still get the following with the tinyurl link:
~~~
The download you requested is unavailable. If you continue to see this
message when trying to access this download, go to the Search for a
Download area on the Download
Alex Martelli wrote:
Martin v. Löwis [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
As suggested to me by David Rushby 10 hours ago,
http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-4
9FD-9CB0-4BFA122FA91Bdisplaylang=en
does work.
Can you please try this again: I'm
John Salerno wrote:
Ron Adam wrote:
When you are working on your programming project on Friday night
instead of going out.
Ok, you win. :)
Oh wait, it's Friday night and I'm typing this message...dang it!
Yep, Hah Hah... No wait, I'm here too. ;-)
--
http://mail.python.org
Ron Adam wrote:
In my program I have a lot of statements that append elements, but
sometimes I don't want to append the element so it requres an if
statement to check it, and that requires assigning the returned element
from a function to a name or calling the funtion twice.
e
Steven D'Aprano wrote:
On Fri, 07 Apr 2006 16:39:40 -0700, jUrner wrote:
Maybe it was not too clear what I was trying to point out.
I have to calculate the time time.time() requires to return the next
tick of the clock.
Should be about 0.01ms but this may differ from os to os.
I suspect
it this way...
def eappend(e1, e2):
if e2 is None: return e1
e1.append(e2)
return e1
Then do...
e = eappend(e, get_element(obj)) # Append if not None.
But maybe there's a better way?
Ron
--
http://mail.python.org/mailman/listinfo/python-list
When you are working on your programming project on Friday night instead
of going out.
When you do go out, you look forward to getting home so you can work on
your programming project some more.
--
http://mail.python.org/mailman/listinfo/python-list
to this class I wrote. I was going to add memget() methods for getting
individual items, but it wasn't as useful as I was hoping it would be
in checking my python memory use. For that I need info on individual
tasks, but this might be better for your use.
Cheers,
Ron
from ctypes import
be...
name = object():
block
This is a bigger change than adding the create keyword, (definitely not
a pre-P3k item), and I'm not sure if it fits your use case, but it does
allow for a larger variety of types without adding additional keywords.
Cheers,
Ron
--
http://mail.python.org
?
/F
Well there's:
PEP 8 -- Style Guide for Python Code
http://www.python.org/dev/peps/pep-0008/
But I presume you already know that one. It covers doc strings some,
but not general documentation. A how-to on documenting would be nice.
Cheers,
Ron
--
http://mail.python.org/mailman
them up. The problem I
have is finding a relatively painless way to do the actual translation.
Thanks in advance for any advise.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
!* :-)
This is what I needed. Now I can play with finding the best data
structure along with what elements to translate each tag to.
This is for a rewrite of PyDoc.py. I'm hoping it will be as easy to
write to other formats from the XML as it is to html.
Cheers,
Ron
--
http
(), but it's explicit about what it's counting and would not return
True on an empty set. I think it would be useful.
true_count, count = countall(S), len(S)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
= {}
for x in seq:
if x in d:
d[x] += 1
else:
d[x] = 1
return d
This neatly replaces truecount(), and you can use it for other things as
well.
if True in talley(S): do_somthing()
Works for me... ;-)
Cheers,
Ron
--
http
a good candidate to be written in C as well.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
Steve R. Hastings wrote:
This neatly replaces truecount(), and you can use it for other things as
well.
if True in talley(S): do_somthing()
Works for me... ;-)
Cheers,
Ron
Actulley talley isn't needed for this...
if True in S: do_domething()
That's
Carl Banks wrote:
Ron Adam wrote:
Carl Banks wrote:
In Python, yes and no are the only possible answers. Probably the only
analogous thing you could do in Python would be for all() to raise
ValueError when passed an empty sequence.
There is also 'None' which serves a similar purpose
...
class vset(set):
... values = set.copy
...
s = vset([1,2,3])
s.values()
vset([1, 2, 3])
for x in s.values():
... x
...
1
2
3
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
Ron Adam wrote:
Where we are assembling widgets in a manufacturing plant. Where we don't
want to go to the next step until *all* the sub parts are present.
if all(part.status == 'present' for part in unit):
do_release()
Oops! Some empty bins showed up
or False.
hasall(S, 'ok')
hasall(S, True, lambda n: n=42)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
hasall(S, True, lambda n: n=42)
That was suppose to be:
hasall(S, True, lambda n: n==42)
--
http://mail.python.org/mailman/listinfo/python-list
passing arguments.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
Ron Adam [EMAIL PROTECTED] writes:
In this view and empty set can be True for all(). Is it posible
'all([])' is undefined? Here, none() and all() return contradicting
values. So maybe the correct version may be...
I don't see any contradiction. all([]) and none
Paul Rubin wrote:
Ron Adam [EMAIL PROTECTED] writes:
Just thinking about things. I really just want what is best for
Python in the long term and am not trying to be difficult.
I'm sorry, maybe it's the math geek in me, but I just see all those
suggestions about not not S as being contorted
. Where we don't
want to go to the next step until *all* the sub parts are present.
if all(part.status == 'present' for part in unit):
do_release()
Oops! Some empty bins showed up at the next assembly station. ;-)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
. So maybe the correct version may be...
def all(S):
if S == []: return False
for x in S:
if x return True
return False
I think a few valid actual use case examples could clear it up. What
makes the most sense?
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo
that use Self in this way might run into problems, but I havn't had
enough coffee to think it though. ;-)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
would be
great if I can get it working.
Thanks for any advice you can give.
--
Ron Davis
--
Ron Davis
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
Ron Adam [EMAIL PROTECTED] wrote:
A Current key word would fix this. Or possibly This which would be
short for This object.
I think This would cause huge confusion, since in other popular
language the keyword this means (a pointer/reference to) the instance
variable
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Alex Martelli) wrote:
One other question I did not get answered: is there any
simple example of a Pythonic use of __slots__ that does NOT
involve the creation of **many** instances.
Since the only benefit of __slots__ is saving a few
within python C code, and not by python source code. If you know how to
make a generator, then you would know how to do simple threads. And
maybe anything needing more than this would be better off being an
external task anyway?
I'm sure there are lots of um... issues. ;-)
Cheers,
Ron
manual and after the tutorial. Looking over the language reference
manual will help in understanding the library reference manual I think.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
= {'a':'b', 'b':'a'} # define outside loop
while 1:
v = values[v] # alternate between 'a' and 'b'
...
There are limits to this, both the keys and the values need to be hashable.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
= [[value]*x for i in xrange(y)]
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
in linear-time?
I'm not sure if it works in linear time, but if there are no duplicates
in each list, sets would be the easiest way to do these with.
s = set([1,2,3,4,5,6])
t = set([4,5,6,7,8,9])
s.intersection(t)
set([4, 5, 6])
len(s.intersection(t))
3
Cheers,
Ron
--
http://mail.python.org
Per wrote:
Thanks Ron,
surely set is the simplest way to understand the question, to see
whether there is a non-empty intersection. But I did the following
thing in a silly way, still not sure whether it is going to be linear
time.
def foo():
l = [...]
s = [...]
dic
() method is called again.
Although there are times when I wish it could run (as a thread) until it
reaches a yield and then continue after the next() method is called
until it reaches the next yield.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
, in ?
StopIteration
This is the signal to indicate iteration is finished. You don't see it
when you are using generators as iterators because it's usually caught
by the object or statement using the generator.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
if there is a reformatter/pretty printer that like perl tidy
that might help. I see i have tabnanny, but that only complains... i
want something that fixes automagically.
-kp8--
What you're looking for is in Python24/Tools/Scripts directory.
Cheers,
Ron
--
http://mail.python.org/mailman
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
Hi
I wonder if Python is capable of the following: define a function which
returns its argument.
I mean:
def magic_function(arg):
.. some magic code ...
that behaves the following way:
assert
Fredrik Lundh wrote:
Tim Parkin wrote:
Also 'Foundation' could be confused with 'beginners' or 'basic'.
while PSF is completely incomprehensible for someone who doesn't
already know what it is... why even keep it on the front page ?
Looks like a good place for a tool tip, PSF is
Fredrik Lundh wrote:
Ron Adam wrote:
I think the PSF is important enough to have a link on *every* page. It
doesn't need a lot of space, but it should be easy to get to from
anywhere on the web site.
a copyright blurb at the bottom of the page would be one obvious place to
put it.
Yes
, then the correct establishment for that is
The Ministry of Silly Walks. ;)
Ron
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Following Ron Adam solution (and using [] instead of list() in the last
line), this may be a possible solution of the problem, that is often
quite fast:
def psort16(s1, s2):
try:
d = dict(izip(s2, s1))
except TypeError:
_indices = range
Ron Adam wrote:
Alex Martelli wrote:
Ron Adam [EMAIL PROTECTED] wrote:
...
Considering the number time I sort keys after getting them, It's the
behavior I would prefer. Maybe a more dependable dict.sortedkeys()
method would be nice. ;-)
sorted(d) is guaranteed to do exactly the same
Scott David Daniels wrote:
Ron Adam wrote:
Ron Adam wrote:
This probably should be:
def psort11(s1, s2):
d = dict(zip(s2,s1))
assert len(d) == len(s1)
s1[:] = list(d[v] for v in sorted(d))
You could do this to avoid all of those lookups:
def psort_xx(s1, s2
501 - 600 of 940 matches
Mail list logo