On Tue, Jun 22, 2010 at 4:23 PM, Ian Bicking wrote:
> This reminds me of the optimization ElementTree and lxml made in Python 2
> (not sure what they do in Python 3?) where they use str when a string is
> ASCII to avoid the memory and performance overhead of unicode.
An optimization that forces
On Tue, May 18, 2010 at 2:50 PM, Antoine Pitrou wrote:
> There's no chance for this since the patch relies on the new GIL.
> (that's unless there's a rush to backport the new GIL in 2.7, of course)
Thanks I missed that detail.
> I think your "rare long delays" might be related to the old GIL's
On Sun, May 16, 2010 at 1:07 PM, Nir Aides wrote:
> Relevant Python issue: http://bugs.python.org/issue7946
Is there any chance Antoine's "gilinter" patch from that issue might
be applied to python 2.7? I have been experiencing rare long delays
in simple io operations in multithreaded python ap
On Fri, Feb 19, 2010 at 9:03 AM, Sjoerd Mullender wrote:
> The policy should also be, if someone decides (or rather, implements) a
> deprecation of a module, they should do a grep to see where that module
> is used and fix the code. It's not rocket science.
I'm not sure if you're aware of it, b
On Mon, Jan 25, 2010 at 11:32 AM, Daniel Stutzbach
wrote:
> On Mon, Jan 25, 2010 at 1:22 PM, Steve Howell wrote:
>>
>> I haven't completely worked out the best strategy to eventually release
>> the memory taken up by the pointers of the unreleased elements, but the
>> worst case scenario is that
On Tue, Nov 3, 2009 at 10:42 AM, Georg Brandl wrote:
> sstein...@gmail.com schrieb:
> >
> > On Nov 3, 2009, at 12:28 PM, Arc Riley wrote:
> >>
> >> The main thing holding back the community are lazy and/or obstinate
> >> package maintainers. If they spent half the time they've put into
> >> comp
On Thu, Jul 16, 2009 at 1:08 PM, Thomas Wouters wrote:
>
> Picking up a rather old discussion... We encountered this bug at Google and
> I'm now "incentivized" to fix it.
>
> For a short recap: Python has an import lock that prevents more than one
> thread from doing an import at any given time.
On 30-Apr-09, at 7:39 AM, Guido van Rossum wrote:
FWIW, I'm in agreement with this PEP (i.e. its status is now
Accepted). Martin, you can update the PEP and start the
implementation.
+1
Kudos to Martin for seeing this through with (imo) considerable
patience and dignity.
-Mike
__
On 9-Apr-09, at 6:24 PM, John Arbash Meinel wrote:
Greg Ewing wrote:
John Arbash Meinel wrote:
And the way intern is currently
written, there is a third cost when the item doesn't exist yet,
which is
another lookup to insert the object.
That's even rarer still, since it only happens the
On 24-Mar-09, at 3:15 PM, Raymond Hettinger wrote:
4% on a micro-micro-benchmark is hardly compelling...
I concur! This is utterly insignificant and certainly does
not warrant removing the checks.
-1 on these sort of fake optimizations. We should focus
on algorithmic improvements and eli
Someone has implemented a version of dir() which is much nicer for
human consumption. The difference is striking enough that I thought
it would be bringing to python-dev's attention.
http://github.com/inky/see/tree/master
>>> pencil_case = []
>>> dir(pencil_case)
['__add__', '__class__', '_
On 2-Feb-09, at 9:21 AM, Hrvoje Niksic wrote:
It turns out that an even faster method of creating an array is by
using the fromstring() method. fromstring() requires an actual
string, not a buffer, so in C++ I created an std::vector
with a contiguous array of doubles, passed that array t
On 29-Jan-09, at 3:38 PM, Daniel Stutzbach wrote:
On Thu, Jan 29, 2009 at 5:24 PM, Mike Klaas
wrote:
And yet, python isn't confined to mathematical notation. *, ** are
both overloaded for use in argument lists to no-one's peril, AFAICT.
Certainly, but there is no danger of conf
On 29-Jan-09, at 3:21 PM, Daniel Stutzbach wrote:
On Thu, Jan 29, 2009 at 4:04 PM, Antoine Pitrou
wrote:
Alexander Belopolsky gmail.com> writes:
> By this analogy, partial(f, ..., *args) is right_partial with '...'
> standing for any number of missing arguments. I you want to specify
> exac
On 13-Dec-08, at 5:28 AM, Michael Foord wrote:
Lie Ryan wrote:
I'm sure probably most of you knows about psyco[1], the optimizer.
Python has an -O and -OO flag that is intended to be optimization
flag, but we know that currently it doesn't do much. Why not add
psyco as standard library an
On 5-Dec-08, at 8:40 AM, A.M. Kuchling wrote:
On Fri, Dec 05, 2008 at 05:40:46AM -, [EMAIL PROTECTED] wrote:
For most users, especially new users who have yet to be impressed
with
Python's power, 2.x is much better. It's not like "library
support" is
one small check-box on the languag
On 11-Nov-08, at 4:16 PM, Mark Dickinson wrote:
More generally, what are the guidelines for determining
when it's appropriate to make something a property rather
than a method?
Both are awkward on numeric types in python, necessitating brackets or
a space before the dot:
(1).__doc__
1 .__d
On 15-Jul-08, at 6:05 AM, Andrew Bennetts wrote:
Ben Finney wrote:
"Stephen J. Turnbull" <[EMAIL PROTECTED]> writes:
That measured only usage of unittest *within the Python standard
library*. Is that the only body of unittest-using code we need
consider?
Three more data points then:
bzr: 13
On 3-Jun-08, at 3:53 PM, Benjamin Peterson wrote:
On Tue, Jun 3, 2008 at 5:08 PM, Jesse Noller <[EMAIL PROTECTED]>
wrote:
Also - we could leave in stubs to match the threading api - Guido,
David
Goodger and others really prefer not to continue the "broken" API
of the
threading API
I agre
On 28-May-08, at 5:44 PM, Greg Ewing wrote:
Mike Klaas wrote:
In my perfect world, strings would be indicable and sliceable, but
not iterable.
An object that was indexable but not iterable would
be a very strange thing. If it has __len__ and __getitem__,
there's nothing to sto
On 28-May-08, at 2:33 PM, Bill Janssen wrote:
From what's been discussed so far, I don't see any advantage
of isinstance(o, String) over hasattr(o, 'encode') or somesuch.
Look, even if there were *no* additional methods, it's worth adding
the base class, just to differentiate the class from
On 2-May-08, at 11:23 PM, Scott David Daniels wrote:
Mike Klaas wrote:
... A common pattern for me is to replace an instances method with a
lambda to add monitoring hooks or disable certain functionality:
inst.get_foo = lambda: FakeFoo()
This is not replacable in one line with a def (or
On 2-May-08, at 4:03 PM, Terry Reedy wrote:
Some people write
somename = lambda args: expression
instead of the more obvious (to most people) and, dare I say, standard
def somename(args): return expression
The difference in the result (the only one I know of) is that the
code and
funct
Hi,
This is not a python-specific problem. See
http://en.wikipedia.org/wiki/Nagle's_algorithm
-Mike
On 17-Apr-08, at 3:08 AM, Robert Hölzl wrote:
hello,
I tried to implement a simple python XMLRPC service on a win32
environment (client/server code inserted below).
The profiler of the client
On 22-Apr-08, at 2:16 PM, Martin v. Löwis wrote:
Any program that needs to examine the contents of
documents/feeds/whatever on the web needs to deal with
incorrectly-specified encodings
That's not true. Most programs that need to examine the contents of
a web page don't need to guess the enc
On 22-Apr-08, at 3:31 AM, M.-A. Lemburg wrote:
I don't think that should be part of the standard library. People
will mistake what it tells them for certain.
+1
I also think that it's better to educate people to add (correct)
encoding information to their text data, rather than give them a
On 20-Mar-08, at 2:32 PM, Christian Heimes wrote:
> Martin v. Löwis schrieb:
>> It seems that recently, a number of merges broke in the sense
>> that files added to the trunk were not merged into the
>> 3k branch.
>>
>> Is that a general problem with svnmerge? Should that be
>> fixed to automatica
On 22-Jan-08, at 8:47 PM, Guido van Rossum wrote:
> While the exact release schedule for 2.5.2 is still up in the air, I
> expect that it will be within a few weeks. This means that we need to
> make sure that anything that should go into 2.5.2 goes in ASAP,
> preferably this week. It also means t
On 3-Jan-08, at 1:07 PM, Guido van Rossum wrote:
> On Jan 3, 2008 11:49 AM, Fred Drake <[EMAIL PROTECTED]> wrote:
>>
>> Python 2.6 seems to be entirely targeted at people who really want to
>> be on Python 3, but have code that will need to be ported. I
>> certainly don't view it as interesting i
On 2-Nov-07, at 6:57 AM, Guido van Rossum wrote:
>
> Since people are already jumping on those bugs but nobody has voiced
> an opinion on your own patch, let me say that I think it's a good
> patch, and I want it in 2.6, but I'm reluctant to add it to 2.5.2 as
> it goes well beyond a bugfix (addin
Issue http://bugs.python.org/issue1663329 details an annoyance in the
subprocess module that has affected several users, including me.
Essentially, closing hundreds of thousands of file descriptors by
round-tripping through the python exception machinery is very slow,
taking hundreds of mi
On 28-Sep-07, at 10:45 AM, Raymond Hettinger wrote:
> [Bruce Frederiksen]
>>> I've added a new function to itertools called 'concat'. This
>>> function is
>>> much like chain, but takes all of the iterables as a single
>>> argument.
>
> Any practical use cases or is this just a theoretical i
In 8-Aug-07, at 12:47 PM, Nick Maclaren wrote:
>
>>> The other approach, which is to stick to true regular expressions,
>>> and wholly or partially convert to DFAs, has already been rendered
>>> impossible by even the limited Perl/PCRE extensions that Python
>>> has adopted.
>>
>> Impossible? Sur
On 8-Aug-07, at 2:28 AM, Nick Maclaren wrote:
> I have needed to push my stack to teach REs (don't ask), and am
> taking a look at the RE code. I may be able to extend it to support
> RFE 694374 and (more importantly) atomic groups and possessive
> quantifiers. While I regard such things as revo
On 6-Jul-07, at 6:45 AM, Yaakov Nemoy wrote:
>
> I can do the other three parts, but I am wondering, how do I write a
> deterministic test unit for my patch? How is it done with the
> threading model in python in general?
I don't know how it is done in general, but for reference, here are
some
On 18-May-07, at 6:34 PM, Raymond Hettinger wrote:
> Here some ideas that have been proposed for sets:
>
> * New method (proposed by Shane Holloway): s1.isdisjoint(s2).
> Logically equivalent to "not s1.intersection(s2)" but has an early-
> out if a common member is found. The speed-up is po
On 15-May-07, at 12:32 AM, Georg Brandl wrote:
>
> There are two problems with this:
> * The set of questions is limited, and bots can be programmed to
> know them all.
Sure, but if someone is customizing their bot to python's issue
tracker, in all likelyhood they would have to be dealt with
On 5/4/07, Baptiste Carvello <[EMAIL PROTECTED]> wrote:
> maybe we could have a "dedent" literal that would remove the first newline and
> all indentation so that you can just write:
>
> call_something( d'''
> first part
> second line
> third line
On 4/30/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> JOSHUA ABRAHAM wrote:
> > I was hoping you guys would consider creating function in os.path or
> > otherwise that would find the full path of a file when given only it's base
> > name and nothing else.I have been made to understand that this is n
On 4/2/07, Shane Geiger <[EMAIL PROTECTED]> wrote:
> I have a curious situation which might be a bug in urllib (Python 2.5
> installed from a .msi file gotten from python.org) when running on
> Windows XP. (This is running inside a Parallels virtual machine, but I
> don't see how that matters, bec
On 3/29/07, Georg Brandl <[EMAIL PROTECTED]> wrote:
> Collin Winter schrieb:
> > The docs for atexit in py3k [1] are mostly (though not all) in
> > italics; I can't figure out why, and I'd appreciate if anyone with
> > stronger latex-foo could take a look.
>
> This is still the same error as in th
On 3/23/07, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Bartlomiej Wolowiec wrote:
>
> > For some time I'm interested in regular expressions and Finite State
> > Machine.
> > Recently, I saw that Python uses "Secret Labs' Regular Expression Engine",
> > which very often works too slow. Its pesymist
On 3/22/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Titus Brown wrote:
>
> > I could add in a 'system'-alike call easily enough; that was suggested.
> > But I think
> >
> > returncode = subprocess.call("program")
> >
> > is pretty simple, isn't it?
>
> Something to keep in mind is that system
On 3/15/07, Mike Krell <[EMAIL PROTECTED]> wrote:
> Here is a point of confusion. Bear in mind I'm running this under
> windows, so explorer happily reports that ".emacs" has a type of
> "emacs". (In windows, file types are registered in the system based
> on the extension -- all the characters
On 3/12/07, Miguel Lobo <[EMAIL PROTECTED]> wrote:
> > Yet, the same can be said for most other patches: they are all for the
> > benefit of users running into the same respective problems.
>
> Agreed. What I mean is that this fasttrack system where the submitter has
> to do some extra work seem
On 3/6/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Although you can get a similar effect now by doing
>
> def __init__(self, **kwds):
> args = dict(prec=None, rounding=None,
>traps=None, flags=None,
>_rounding_decision=None,
>
On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote:
> Except, all the numeric types do, including int, float, and complex. But
> not bool.
Oh?
In [5]: str(complex(1, 2))
Out[5]: '(1+2j)'
In [6]: complex(str(complex(1, 2)))
On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote:
> Well consider this:
> >>>str (4)
> '4'
> >>>int(str (4))
> 4
> >>>str (False)
> 'False'
>
> >>>bool(str(False))
> True
>
> Doesn't this seem a bit inconsisent?
Virtually no python objects accept a stringified version of themselves
in their cons
On 2/13/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Mike Klaas wrote:
>
> > As a comparison, enumerate (that I would have believed was much more
> > frequent a priori), is used 67 times, and zip/izip 165 times.
>
> By that argument, we should be considering a spe
On 2/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Mike> As a comparison, enumerate (that I would have believed was much
> Mike> more frequent a priori), is used 67 times, and zip/izip 165 times.
>
> But (get|set|has)attr has been around much longer than enumerate. I'm
> almost ce
On 2/13/07, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> As for people who say, "but getattr, setattr, and delattr aren't used";
> please do some searches of the Python standard library. In a recent
> source checkout of the trunk Lib, there are 100+ uses of setattr, 400+
> uses of getattr (perhaps
On 2/12/07, Hrvoje Nikšić <[EMAIL PROTECTED]> wrote:
> cause problems for other users of the interned string. I agree with the
> reasoning, but propose a different solution: when interning an instance
> of a string subtype, PyString_InternInPlace could simply intern a copy.
Interning currently r
On 1/23/07, Kristján V. Jónsson <[EMAIL PROTECTED]> wrote:
> Hello there.
>
> I am trying to insert a hook into python enabling a callback for all
> just-created objects. The intention is to debug and find memory leaks, e.g.
> by having the hook function insert the object into a WeakKeyDictionary
On 1/12/07, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [A.M. Kuchling]
> > 2.6 wouldn't go changing existing APIs to begin requiring or returning
> > the bytes type[*], of course, but extensions and new modules might use
> > it.
>
> The premise is dubious.
>
> If I am currently maintaining a mo
On 1/4/07, Ralf W. Grosse-Kunstleve <[EMAIL PROTECTED]> wrote:
> It would be nice if this simple fix could be included (main branch and 2.5.1):
>
> https://sourceforge.net/tracker/?func=detail&aid=1598181&group_id=5470&atid=105470
>
> [ 1598181 ] subprocess.py: O(N**2) bottleneck
>
> I submitted
On 12/22/06, Evgeniy Khramtsov <[EMAIL PROTECTED]> wrote:
> The question to python core developers:
> Is there any plans to implement non-blocking timer like a
> threading.Timer() but without thread?
> Some interpreted languages (like Tcl or Erlang) have such functionality,
> so I think it would be
On 12/6/06, Alastair Houghton <[EMAIL PROTECTED]> wrote:
[from previous message]:
>> Anyway, clearly what people will expect here (talking about the match
>> object API) is that m[3:4] would give them a list (or some equivalent
>> sequence object) containing groups 3 and 4. Why do you think someo
On 10/18/06, Tim Peters <[EMAIL PROTECTED]> wrote:
> [Mike Klaas]
> > Indeed.
>
> Note that I just attached a much simpler pure-Python script that fails
> very quickly, on Windows, using a debug build. Read the new comment
> to learn why both "Windows"
On 10/18/06, Michael Hudson <[EMAIL PROTECTED]> wrote:
> "Mike Klaas" <[EMAIL PROTECTED]> writes:
> I've been reading the bug report with interest, but unless I can
> reproduce it it's mighty hard for me to debug, as I'm sure you know.
Indeed.
>
[http://sourceforge.net/tracker/index.php?func=detail&aid=1579370&group_id=5470&atid=105470]
Hello,
I'm managed to provoke a segfault in python2.5 (occasionally it just a
"invalid argument to internal function" error). I've posted a
traceback and a general idea of what the code consists of in th
60 matches
Mail list logo