[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] dynamically link swig runtime on windows (Can I commit this?)

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2003-08-08 03:23:12 CEST

Branko Čibej wrote:
> Should do, my 5.8 prints "5.008", and your regexp should match that
> nicely. But there's no need to use regular expression matching here:
>
> import string
> def perl_library(version):
> dot = string.find(version, '.')
> if dot < 0 or len(version) < dot+4:
> return None
> return 'perl' + version[0:dot] + str(int(version[dot+1:dot+4]))

Well technically, there's no need to use regular expressions anywhere. In
this case, I think using a regex is better because it makes the expected
form of the version string a little more obvious.

> Funny though, I tried "string.lstrip(version[dot+1:dot+4], '0')", but
> it seems that lstrip doesn't take the second argument even though it's
> documented...

The docs do say that argument was added in 2.2.3
(http://www.python.org/doc/current/lib/module-string.html#l2h-817). I tried
to use that function too.

- Russ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 22 02:50:03 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.