Michael Spencer wrote:
> Announcing: compiler2
> -
>
> For all you bytecode enthusiasts: 'compiler2' is an alternative to the
> standard
> library 'compiler' package, with several advantages.
Is this a rewrite from scratch, or an improved stdlib compiler package?
In the la
Tuomas wrote:
> #!/usr/bin/python
> """test pydev_0.9.3/../pylint"""
> __revision__ = "test_mod 0.1 by TV 06/10/22"
>
> lst = ['aaa', ' bbb', '\tccc\n']
> lst = map(lambda x: x.strip(), lst)
>
> result = """
> No config file found, using default configuration
> * Module test_mod
> W:
Tuomas wrote:
> Georg Brandl wrote:
>> Some people think that all occurences of map() must be replaced
>> by list comprehensions. The designer of pylint seems to be
>> one of those.
>
> So it seems, but why?
See Fredrik's post. There's no error in the
Michael Spencer wrote:
> Georg Brandl wrote:
>> Michael Spencer wrote:
>>> Announcing: compiler2
>>> -
>>>
>>> For all you bytecode enthusiasts: 'compiler2' is an alternative to the
>>> standard
>>&
J. Clifford Dyer wrote:
> >>> (1 > 0) < 1
> False
> >>> 1 > 0 < 1
> True
> >>> 1 > (0 < 1)
> False
> >>> 10 > (0 < 1)
> True
I hope you know why this works the way it does.
Georg
--
http://mail.python.org/mailman/listinfo/python-list
MindClass wrote:
> Is possible import a library according to a condition?
>
> if Foo = True:
> import bar
>
Why don't you try it?
(in the above code, not the import is the problem, but using the
assignment operator in an expression)
Georg
--
http://mail.python.org/mailman/listinfo/python-
[EMAIL PROTECTED] wrote:
> I'm starting to read about twisted and I keep seeing things like:
> [from twisted/internet/app.py]
>
> def __init__(self, name, uid=None, gid=None, authorizer=None,
> authorizer_=None):
> """Initialize me.
> If uid and gid arguments are not provided,
J. Clifford Dyer wrote:
> Georg Brandl wrote:
>> J. Clifford Dyer wrote:
>>
>>> >>> (1 > 0) < 1
>>> False
>>> >>> 1 > 0 < 1
>>> True
>>> >>> 1 > (0 < 1)
>>> False
>>> >
Chetan wrote:
>> Steven D'Aprano wrote:
>> > On Sat, 28 Oct 2006 03:13:42 +0100, Steve Holden wrote:
>> >
>> >>> Finally, while True/False is a good mental mapping for numeric
>> >>> comparisons,
>> >>> take the following:
>> >>>
>> >>> >>> if "Cliff is a pillar of the open source community":
>>
Chetan wrote:
>>> I am joining after some network downtime here, so I seem to have missed what
>>> the real issue here is. At the risk of being completely irrelevant to the
>>> discussion here, I think it doesn't seem to be just about something or
>>> nothing - is None something or nothing? It see
Létező wrote:
> I use Python 2.4.4. Please read the code below:
>
> ---
> from new import classobj
>
> def mymeta(name,bases,clsdict):
> print 'meta: %s'%name
> return classobj(name,bases,clsdict)
>
> class A(object):
> __metacl
James Stroud wrote:
> I think that it would be handy for enumerate to behave as such:
>
> def enumerate(itrbl, start=0, step=1):
>i = start
>for it in itrbl:
> yield (i, it)
> i += step
>
> This allows much more flexibility than in the current enumerate,
> tightens up code in m
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Simon Wittber
> wrote:
>
>> I'd also like to remove any deprecated or stuff which is left in for
>> backwards functionality (eg Classic classes).
>
> Classic classes are still needed for exceptions:
>
class E(object):
> ...pass
>
Paul McGuire wrote:
> "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> In <[EMAIL PROTECTED]>, Simon Wittber
>> wrote:
>>
>>> I'd also like to remove any deprecated or stuff which is left in for
>>> backwards functionality (eg Classic classes).
>>
>> Clas
Thomas W wrote:
> I'm getting really annoyed with python in regards to
> unicode/ascii-encoding problems.
>
> The string below is the encoding of the norwegian word "fødselsdag".
>
s = 'f\xc3\x83\xc2\xb8dselsdag'
Which encoding is this?
> I stored the string as "fødselsdag" but somewhere i
Peter van Kampen schrieb:
> On 2006-11-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>> I've collected a bunch of list pydioms and other notes here:
>>
>> http://effbot.org/zone/python-list.htm
>
> """
> A = B = [] # both names will point to the same list
> """
>
> I've been bitten by this onc
Diez B. Roggisch schrieb:
> Diez B. Roggisch schrieb:
>> Matthias Winterland schrieb:
>>> Hi,
>>>
>>> I have a simple question. When I read in a string like:
>>> a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a
>>> single split-call?
>>
>> Nope. But you could replace the com
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 no good advantage, IMHO. I was coding in Ruby for several
>> months and got very comfortabl
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' conditional, a la C and its derivatives. That is, it's un
George Sakkis wrote:
> Fredrik Lundh wrote:
>
>> John Reese wrote:
>>
>> > It seems like it would be clear and mostly backwards compatible if the
>> > + operator on any iterables created a new iterable that iterated
>> > throught first its left operand and then its right, in the style of
>> > iter
Carl Banks wrote:
> Georg Brandl wrote:
>> What has a better chance of success in my eyes is an extension to yield
>> all items from an iterable without using an explicit for loop: instead of
>>
>> for item in iterable:
>> yield item
>>
>> you c
Michael Hobbs 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' conditional, a la C and
Skip Montanaro schrieb:
>> Since that the decorator syntax is upon us, I think it would be good if
>> atexit.register() was returning the function passed as argument. This
>> simple change to the library would solve a problem with the use of
>> atexit.register as a decorator (and I can't think of
Steve Holden wrote:
> su wrote:
>> to find which process dumped core at the promt we give
>>
>> $ file core.28424
>>
>> core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11),
>> Intel 80386, version 1 (SYSV), from 'soffice.bin'
>>
>> from this command we know 'soffice.bin' process du
Carl J. Van Arsdall wrote:
> So this is probably a fairly basic question, but help me out because I'm
> just not lining things up and I'm somewhat new to the world of exception
> handling.
>
> What's the benefit to inheriting an exception from and of the available
> parent exception classes? D
George Sakkis wrote:
> Ben Finney wrote:
>
>> "Gregory Petrosyan" <[EMAIL PROTECTED]> writes:
>>
>> > I often make helper functions nested, like this:
>> >
>> > def f():
>> > def helper():
>> > ...
>> > ...
>> >
>> > is it a good practice or not?
>>
>> You have my blessing. Used we
Nadav Samet wrote:
> Hi,
>
> I am trying to unpack a 32-bit unsigned integer from a string using
> struct.unpack.
> so using string.unpack('L', data) would work fine on 32-bit systems,
>
> But apparently, on 64-bit platforms it tries to read 64-bit unsigned
> integer (since
> that's what the C T
Nick Maclaren wrote:
> In article <[EMAIL PROTECTED]>,
> Robert Kern <[EMAIL PROTECTED]> writes:
> |> Nick Maclaren wrote:
> |> > The way that I read it, Python allows only values (and hence types)
> |> > to be immutable, and not class members. The nearest approach to the
> |> > latter is to use t
Steve Holden wrote:
>>>Thanks very much. And, what's more, I have even found its documentation!
>>>Whatsnew2.2. The 2.4.2 reference is, er, unhelpful.
>>
>>
>> Is it?
>>
>> http://docs.python.org/lib/built-in-funcs.html
>>
>> documents "property" quite well.
>>
> I can't really agree that "
Erik Max Francis wrote:
> a wrote:
>
>> def fn():
>> for i in range(l)
>>global count
>>count[i]=
>>
>> how do i declare count to be global if it is an array
>
> count = [...]
>
> def fn():
> global count
> for i in range(l):
>
Bruno Desthuilliers wrote:
> a wrote:
>> def fn():
>> for i in range(l)
>
> l is not defined - you should have an error here.
>
>>global count
>>count[i]=
>>
>> how do i declare count to be global if it is an array
>
> Just like it was an integer
No. If he's on
Duncan Booth wrote:
> Georg Brandl wrote:
>
>> In my opinion property isn't really meant to be used as a decorator since
>> it's impossible to create a read-write property. The decorator pattern
>> doesn't really fit here.
>>
> I agree that p
Nick Maclaren wrote:
> In article <[EMAIL PROTECTED]>,
> "Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> |>
> |> identical? you only applied @property to one of the methods, and then
> you're
> |> surprised that only one of the methods were turned into a property?
>
> I wasn't expecting EITHER to
Bruno Desthuilliers wrote:
> Georg Brandl wrote:
>> Bruno Desthuilliers wrote:
>>
>>>a wrote:
>>>
>>>>def fn():
>>>> for i in range(l)
>>>
>>>l is not defined - you should have an error here.
>>>
>>>
[EMAIL PROTECTED] wrote:
> I use generators a lot. E.g.
>
>
> def gen_words(text)
> ... parse text ...
> yield each word in text
>
> for word in gen_words(text):
> print word
>
>
> I don't like the name gen_xxx() very much. Looking for some inspiration
> to name generators. Here are some
Steve Holden wrote:
> Georg Brandl wrote:
>> Nick Maclaren wrote:
>>
>>>In article <[EMAIL PROTECTED]>,
>>>"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
>>>|>
>>>|> identical? you only applied @property to one of the
Nick Maclaren wrote:
> Currently logins are disabled to sourceforge.net, and (despite the
> comments) it won't let me report a bug anonymously. Does anyone
> know whether this is short or long term? I have a bug in 2.5 to
> report - which has been there for a while and isn't overwhelmingly
> crit
Steve Holden wrote:
> Georg Brandl wrote:
>> Steve Holden wrote:
> [...]
>>
>>>Would it make sense, in the single argument case, to default the doc
>>>value to fget.__doc__ to support that use case, or should we just not
>>>create read-onl
Bruno Desthuilliers wrote:
> looping wrote:
>> Michele Petrazzo wrote:
>>
>>>Bruno Desthuilliers wrote:
>>>
>but what the better
Depends on the context.
>>>
>>>If know only one context: see if the key are into the dict... What other
>>>context do you know?
>>>
>>
>> Why do you
Bruno Desthuilliers wrote:
>>> value = dict.get(key, None)
>>
>>
>> value = dict.get(key)
>
> Yes - but :
> 1/ not everybody knows that dict.get() takes a second optional param.
> Note that, while it happens that the default return value of dict.get()
> is the same as in the above example, but
Georg Brandl wrote:
> Steve Holden wrote:
>> Georg Brandl wrote:
>>> Steve Holden wrote:
>> [...]
>>>
>>>>Would it make sense, in the single argument case, to default the doc
>>>>value to fget.__doc__ to support that use case, or sho
Michael Abbott wrote:
> In article <[EMAIL PROTECTED]>,
> John Salerno <[EMAIL PROTECTED]> wrote:
>
>> > (http://docs.python.org/lib/built-in-funcs.html#l2h-24)
>> > "It is different from the import statement in that it does not use the
>> > module administration --"
>>
>> Just after the above s
Peter Maas wrote:
> The docs tell us
> (http://www.python.org/doc/2.4.2/lib/built-in-funcs.html):
>
> - begin ---
> execfile(filename[, globals[, locals]])
>
> This function is similar to the exec statement, but parses a file
> instead of a str
Michael Abbott wrote:
> In article <[EMAIL PROTECTED]>,
> Georg Brandl <[EMAIL PROTECTED]> wrote:
>> That's because __name__ is normally set to the module's name in the package
>> hierarchy. When you set it to "some1.some2", Python thinks it'
John Machin wrote:
> Apologies in advance if this is a bit bloggy, but I'd like to get
> comments on whether I've lost the plot (or, more likely, failed to
> acquire it) before I start reporting bugs etc.
Please forward to Gerhard Haering if you still
think these are bugs.
Georg
--
http://mai
aliassaf wrote:
> Hello,
>
> If we write = x^2 and if I give to the program the values of x, it will
> going to calculate the values of y, and also for x.
>
> But it is possible ? that is if I give to the program the values of X and Y,
> it will indicate to me the relation between the two
[EMAIL PROTECTED] wrote:
> Ok, maybe this is a stupid question, but why can't I make a subclass of
> datetime.date and override the __init__ method?
>
> ---
>
> from datetime import date
>
> class A(date):
> def __init__(self, a, b, c, d):
> print a, b, c, d
> date.__init__(s
Antoon Pardon wrote:
> I have been reading http://www.python.org/dev/peps/pep-3100/
> en there is written:
>
> To be removed:
> ...
>
> callable(): just call the object and catch the exception
>
> ...
> Is there a chance this will be reconsidered?
>
There was some discus
[EMAIL PROTECTED] wrote:
> For example i write the following code in the Python command line;
>
list = ['One,Two,Three,Four']
>
> Then enter this command, which will then return the following;
>
> ['One,Two,Three,Four']
This is already wrong. Assignments do not return anything.
Georg
--
h
Anthra Norell wrote:
> No, I am not running Linux to any extent. But I am very strict about case.
> There is not a single instance of "se.py" or "sel.py"
> anywhere on my system. You' ll have to find out where lower case sneaks in on
> yours. The zip file preserves case and in the zip file
> the
Fredrik Lundh wrote:
> Kurt B. Kaiser wrote:
>
>> Patch / Bug Summary
>> ___
>>
>> Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20)
>> Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42)
>> RFE : 232 open ( +3) / 236 closed ( +1) / 468 tot
Bruno Desthuilliers wrote:
> Georg Brandl a écrit :
>> Antoon Pardon wrote:
>>
>>> I have been reading http://www.python.org/dev/peps/pep-3100/
>>> en there is written:
>>>
>>> To be removed:
>>> ...
>>&
Antoon Pardon wrote:
> On 2006-08-23, Georg Brandl <[EMAIL PROTECTED]> wrote:
>> jojoba wrote:
>>>> And what im saying is that isnt it silly that we need pass an entire
>>>> namespace, when a much simpler notion would be to have each object know
>>>&
Claudio Grondi wrote:
> Tim Peters wrote:
>> [Claudio Grondi]
>>
>>> Here an example of what I mean
>>> (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte
>>> large file):
>>>
>>> >>> f = file('veryBigFile.dat','r')
>>> >>> f = file('veryBigFile.dat','r+')
>>>
>>> Traceback (m
Maxim Sloyko wrote:
> Laurent Pointal wrote:
>>
>> Look at http://wiki.python.org/moin/WebFrameworks
>>
>> Do you *really* need to develop a *new* framework (maybe a scholl
>> exercise - it that case, KISS)?
>
> Isn't the main reason why there are so many of them is that all of them
> suck badly?
Chaz Ginger wrote:
> glenn wrote:
>>> Shouldn't that be
>>>
>>> beagle = animal.dog()
>>>
>>> to create an instance?
>>>
>>> We've all done it ...
>> lol - actually Im confused about this - there seem to be cases where
>> instantiaing with:
>> instance=module.classname()
>> gives me an error, but
>
noro wrote:
> Is it possible to do the following:
>
> for a certain class:
>
>
> class C:
>
> def func1(self):
> pass
> def func2(self):
> pass
> def func4(self):
> pass
>
> obj=C()
>
>
> by some w
alf wrote:
> Robert Kern wrote:
>> alf wrote:
>>
>>> Fredrik Lundh wrote:
>>>
http://www.catb.org/~esr/faqs/smart-questions.html#writewell
>>>
>>>
>>> and means?
>>
>>
>> It's his signature.
>>
>
> The sig is delimited by '-- \n'
Yes, and Earth is a disk.
Georg
--
http://ma
xamdam wrote:
> I am not sure if this came up before, but I would love to have an
> 'assignment-in-conditional' form in python, e.g
>
> pat = re.compile('something')
>
> if m = pat.match(s):
> m.group(1)
>
> Of course there is some concern about accidentally using '=' instead of
> '=='. One
Manuel Bleichner wrote:
> Hello list,
>
> I have searched for some time now, but no result...
> I'm having the following problem:
>
> In a module I have a huge number of classes of the form:
>
> class A(object):
>connected_to = [B, C]
>
>
> class B(object)
>connected_to = [C]
>
[EMAIL PROTECTED] wrote:
> Hendrik van Rooyen wrote:
>> <[EMAIL PROTECTED]> Wrote:
>>
>>
>> |
>> | Haha. How can I fix this!
>> |
>> |
>> |
>>
>> Use either tabs, or spaces, but not both
>>
>> - Hendrik
>
> Haha. I know. I just find it silly that a language insists on
> indentation. I'd long k
lazaridis_com wrote:
> I would like to fulfill the following task:
>
> The construct:
>
> if __name__ == '__main__':
>
> should be changed to something like:
>
> if identifier.name == '__main__':
>
> The term "identifier" should be selected based on the meaning of the
> __double-underscore-enc
lazaridis_com wrote:
> Georg Brandl wrote:
>> lazaridis_com wrote:
>> > I would like to fulfill the following task:
>> >
>> > The construct:
>> >
>> > if __name__ == '__main__':
>> >
>> > should be changed
enigmadude wrote:
> As many have heard, IronPython 1.0 was released. When I was looking
> through the listed differences between CPython and IronPython, the
> document mentioned that using large exponents such as 10 **
> 735293857239475 will cause CPython to hang, whereas IronPython will
> raise a
Steve Holden wrote:
>> I am not a (python) domain expert.
>>
>> Thus I am asking here for available standard-solutions, before I
>> implement an own solution.
>>
> There is no standard solution for the problem you mention.
Because it's not a problem for most people ;)
Georg
--
http://mail.pyt
metaperl wrote:
> On p.282 of "Python Cookbook" and in the Python docs on calling super:
> http://www.python.org/download/releases/2.2.3/descrintro/#cooperation
>
> it is clear that the first argument to super is a class and not a type.
> However, for the code below, I am getting an error when att
Download the release at <http://www.pocoo.org/download>.
Cheers,
Georg Brandl, on behalf of the Pocoo Team
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> The following program does not work if you uncomment #lis =
> ["xmms2"] + list(args)
>
> Evidently Python is opting for the nullary constructor list() as
> opposed to the other one which takes a sequence. But no newcomer would
> know this. And the Python docs dont gi
Ant wrote:
> Anthony Baxter wrote:
> ...
>> code in 2.5 before the final release. *Please* try this
>> release out and let us know about any problems you find.
>
> Not a problem with the release, but with the docs. I've just ported a
> module using the ElementTree package to 2.5, and the Module In
Georg Brandl wrote:
> Ant wrote:
>> Anthony Baxter wrote:
>> ...
>>> code in 2.5 before the final release. *Please* try this
>>> release out and let us know about any problems you find.
>>
>> Not a problem with the release, but with the docs. I
Ilias Lazaridis wrote:
> I understand that I can use __metaclass__ to create a class which
> modifies the behaviour of another class.
>
> How can I add this metaclass to *all* classes in the system?
>
> (In ruby I would alter the "Class" class)
You'd have to set
__metaclass__ = whatever
at the
Damjan wrote:
>>> I understand that I can use __metaclass__ to create a class which
>>> modifies the behaviour of another class.
>>>
>>> How can I add this metaclass to *all* classes in the system?
>>>
>>> (In ruby I would alter the "Class" class)
>>
>> You'd have to set
>>
>> __metaclass__ = w
Diez B. Roggisch wrote:
>>>
>>> I think '__metaclass__ = whatever' affects only the creation of
>>> classes that
>>> would otherwise be old-style classes?
>>
>> Wrong.
>>
>> If you set __metaclass__ = type, every class in that module will be
>> new-style.
>>
>> If you set __metaclass__ = MyCla
Dustan wrote:
> MonkeeSage wrote:
>> Dustan wrote:
>> > I did do a search here, but came up empty-handed. Can anyone tell me
>> > how to get the webbrowser module to recognize firefox's existence,
>> > given this information?
>>
>> Looks like it is checking %PATH% for firefox.exe. Try:
>>
>> >>> im
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Fredrik
> Lundh wrote:
>
>> Jon Ribbens wrote:
>>
>>> Making cgi.escape always escape the '"' character would not break
>>> anything, and would probably fix a few bugs in existing code. Yes,
>>> those bugs are not cgi.escape's fault, bu
[EMAIL PROTECTED] wrote:
> Kind people,
> Is there any way one can, within Python, intercept the act of
> assignment. For instance, suppose that I was obsessed with
> FORTRAN II, and decided that I wanted to print a warning,
> or raise an exception any time someone assigned an int to a
> variable
[EMAIL PROTECTED] wrote:
> My understanding of the __future__ statement is that you may say
> something like:
>
> from __future__ import foo, bar
>
> to enable more than one feature. However, this does not seem to be
> working properly in 2.5; it behaves as expected when typed into the
> interac
Michael J. Fromberger wrote:
> In article <[EMAIL PROTECTED]>,
> "Terry Reedy" <[EMAIL PROTECTED]> wrote:
>
>> <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>> > Did anyone else crack up when Larry Wall described python with the
>> > statement:
>> >
>> > Python, as the "anti-Per
[EMAIL PROTECTED] wrote:
>> http://pyfaq.infogami.com/
>
> Tell me more?
>
> Clueless newbie me, thru this door I'm at three deaths and counting.
> Does that Py Faq Wiki have a sandbox a la alt.test, and/or a tutorial?
>
> // Death One:
>
> http://pyfaq.infogami.com/_account/in?path=/
> require
Jon Ribbens wrote:
> In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote:
>>> There's nothing to say that cgi.escape should take them both into account
>>> in the one function
>>
>> so what exactly are you using cgi.escape for in your code ?
>
> To escape characters so that they will be treated a
Christophe wrote:
> Steven D'Aprano a écrit :
>> By memory, in an thread about the same topic just a few days ago, Fredrik
>> Lundh posted a link to Perl's FAQs that suggests a method for "validating"
>> email addresses: treat it like a password and ask the user to type it
>> twice. That will prote
Jon Ribbens wrote:
> In article <[EMAIL PROTECTED]>, Max M wrote:
>> Oh ... because you cannot see a use case for that *documented*
>> behaviour, it must certainly be wrong?
>
> No, but if nobody else can find one either, that's a clue that maybe
> it's safe to change.
>
> Here's a point for you
Christophe wrote:
> Georg Brandl a écrit :
>> Christophe wrote:
>>> Steven D'Aprano a écrit :
>>>> By memory, in an thread about the same topic just a few days ago,
>>>> Fredrik
>>>> Lundh posted a link to Perl's FAQs that suggest
Thorsten Kampe wrote:
> * John Machin (24 Sep 2006 15:32:20 -0700)
>>Antoine De Groote wrote:
>>> is there a python equivalent for the ruby %w operator?
>>> %w{a b c} creates an array with strings "a", "b", and "c" in ruby...
>>>
>>
>>| >>> "a b c".split()
>>| ['a', 'b', 'c']
>>
>>... appears to ma
[EMAIL PROTECTED] wrote:
> Hi all. How do I escape the "%" sign in a print statement so that it
> prints? Thanks.
>>> print "%"
%
Did you mean in a string being interpolated with the % operator?
Georg
--
http://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Max M wrote:
>
>> Lawrence is right that the escape method doesn't work the way he expects
>> it to.
>>
>> Rewriting a library module simply because a developer is surprised is a
>> *very* bad idea.
>
> I'm not surprised. Disappointed,
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Fredrik
> Lundh wrote:
>
>> Lawrence D'Oliveiro wrote:
>>
>>>> Georg Brandl wrote:
>>>>
>>>>> A function is broken if its implementation doesn't matc
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Georg Brandl wrote:
>
>> Lawrence D'Oliveiro wrote:
>>> In message <[EMAIL PROTECTED]>, Max M wrote:
>>>
>>>> Lawrence is right that the escape method doesn't work
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Georg Brandl wrote:
>
>> Lawrence D'Oliveiro wrote:
>>> In message <[EMAIL PROTECTED]>, Georg Brandl wrote:
>>>
>>>> Lawrence D'Oliveiro wrote:
>>>>>
Fredrik Lundh wrote:
> Sion Arrowsmith wrote:
>>
>
>>> based on http://docs.python.org/ref/types.html, here's a list of the
>>> most commonly used core types:
>>> [ ... ]
>>> Sequences:
>>> str
>>> unicode
>>> tuple
>>> list
>>
>> And set, presumably.
>
> absolutely!
>
> howeve
Anthony Baxter wrote:
>> I would really rather this were a discussion than an argument. You will
>> now no doubt reply telling me I wouldn't.
>>
>> My posting was issued as a response to the irritation engendered by your
>> argumentative style of debate. Your latest response simply proves that
>> t
James Stroud wrote:
> Hello All,
>
> Still jubilantly configuring my work environment for python 2.5, I came
> accross a curiosity when writing an automatic vim syntax file creator
> (so I can automatically update my syntax coloring with future python
> releases).
>
> It seems I can find a ref
tobiah wrote:
> wesley chun wrote:
>>> "Terry Reedy" <[EMAIL PROTECTED]> wrote:
>>> > as a side note, the ints that are cached (for current versions of
>>> > Python) are in range(-1, 100)... is this documented somewhere?
>>> Not true for at least 2.4 and 2.5. The cached range has expanded
>>
>> o
tobiah wrote:
>>> Suppose I fill an list with 100 million random integers in the range
>>> of 1 - 65535. Wouldn't I save much memory if all of the ocurrances
>>> of '12345' pointed to the same integer object? Why should more be made,
>>> when they all do the same thing, and are not subject to cha
[EMAIL PROTECTED] wrote:
> So I just got bitten by the "don't use a mutable object as an optional
> argument" gotcha. I now realize that for this function:
>
def func(x, y=[]):
> ... y.append(x)
> ... print y
> ...
>
> y is initialized when the function is imported, not when the fun
Terry Reedy wrote:
> "Georg Brandl" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> tobiah wrote:
>>> Suppose I fill an list with 100 million random integers in the range
>>> of 1 - 65535. Wouldn't I save much memory if all o
[EMAIL PROTECTED] wrote:
> Hello all, please correct me, if I do...
>
> from ClientForm import ParseResponse
> from urllib2 import urlopen
> ...
> response=urlopen(url)
> forms=ParseResponse(response)
>
> I won't be able to
>
> print response.read()
>
> in order to see HTML source anymore. In o
Antoon Pardon wrote:
> On 2006-09-27, George Sakkis <[EMAIL PROTECTED]> wrote:
>> Antoon Pardon wrote:
>>
>>> What bothers me a bit about the rejection of PEP 326 is that one of the
>>> reasons stated is:
>>>
>>> http://mail.python.org/pipermail/python-dev/2004-January/042306.html
>>>
>>> - it
Antoon Pardon wrote:
> On 2006-09-27, OKB (not okblacke) <[EMAIL PROTECTED]> wrote:
>> Antoon Pardon wrote:
>>
>>> To begin with this already fails:
>>>
>> for i in xrange(Top):
>>> ... print i
>>
>> What do you expect this to do? Loop forever?
>
> Yes that is what I would expect.
Fo
Sheldon wrote:
> Hi,
>
> Does anyone know if it is possible to resume the execution of a program
> after it stops at an error in the code and the error was corrected?
try:
do something
except SomeException:
correct the error
do something else
i.e. you handle the error in the except cl
101 - 200 of 309 matches
Mail list logo