On 2011-12-20, at 11:08 , Antoine Pitrou wrote:
> But that's basically the only reason to invoke the
> `operator.attrgetter("foo")` ugliness, instead of writing the explicit
> and obvious `lambda x: x.foo`.
I don't agree with this, an attrgetter in the current namespace can be clearer
than an expl
On 2012-01-08, at 01:27 , Antoine Pitrou wrote:
>>> When you say MoveFile is absent, is MoveFileEx supported instead?
>> WinRT strongly prefers asynchronous methods for all lengthy
>> operations. The most likely call to use for moving files is
>> StorageFile.MoveAsync.
>> http://msdn.microsoft.co
On 2012-01-13, at 16:34 , anatoly techtonik wrote:
> Posting to python-dev as it is no more relates to the idea of improving
> print().
>
>
> sys.stdout.write() in Python 3 causes backwards incompatible behavior that
> breaks recipe for unbuffered character reading from stdin on Linux -
> http://
On 2012-01-13, at 17:19 , Antoine Pitrou wrote:
>
> "-u" forces line-buffering mode for stdout/stderr, which is already the
> default if they are wired to an interactive device (isattr() returning
> True).
Oh, I had not noticed the documentation had changed in Python 3 (in
Python 2 it stated that
On 2012-02-14, at 08:58 , Stefan Behnel wrote:
>
> These days, other Python implementations already provide the cElementTree
> module as a bare alias for ElementTree.py anyway, without emitting any
> warnings. Why should CPython be the only one that shouts at users for
> importing it?
Since all w
On 2012-02-20, at 12:36 , Eli Bendersky wrote:
> On Mon, Feb 20, 2012 at 01:12, "Martin v. Löwis" wrote:
>
>>> The change of backing ElementTree by cElementTree has already been
>>> implemented in the default branch (3.3) by Florent Xicluna with careful
>>> review from me and others. etree has an
On 2012-02-21, at 21:24 , Brett Cannon wrote:
> On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote:
>
>> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote:
>>
>>> 2012/2/21 Antoine Pitrou :
Hello,
Shouldn't it be enabled by default in 3.3?
>>
>> Yes.
>>
>>> Should you
On 2012-02-27, at 19:53 , Victor Stinner wrote:
> Rationale
> =
>
> A frozendict type is a common request from users and there are various
> implementations. There are two main Python implementations:
>
> * "blacklist": frozendict inheriting from dict and overriding methods
> to raise a
On 2012-05-09, at 01:41 , Alex Leach wrote:
>
> True. I might not need the CDATA tag to wrap the javascript then, but I still
> need < and > symbols. I have no idea how to write a loop in javascript
> without
> one.
Erm… you have them? What do you think `<` and `>` are?
As to writing a loop
On 5 juin 2012, at 14:24, Nick Coghlan wrote:
> On Tue, Jun 5, 2012 at 8:25 PM, Nick Coghlan wrote:
>> On Tue, Jun 5, 2012 at 7:11 PM, Michael Foord
>> wrote:
>>>
>>> On 5 Jun 2012, at 08:53, Nick Coghlan wrote:
>>>
[snip...]
Now, one minor annoyance with current class decora
On 2012-06-08, at 20:29 , Brett Cannon wrote:
> On Fri, Jun 8, 2012 at 2:21 PM, fwierzbi...@gmail.com > wrote:
>
>> On Fri, Jun 8, 2012 at 10:59 AM, Brett Cannon wrote:
>>> R. David already replied to this, but just to reiterate: tests can always
>>> get updated, and code that fixes a bug (and l
On 2012-08-02, at 09:28 , Shanth Kumar wrote:
> Hi I am Shanthkumar from Bangalore, India, working for a software firm.
> Good to see the mailing group, as i am new to python curious to ask you
> people couple of queireis.
I fear that is very likely the wrong mailing list for that: python-dev
is
On 21 août 2012, at 19:25, Steven D'Aprano wrote:
> On 21/08/12 23:04, Victor Stinner wrote:
>
>> I don't like the timeit module for micro benchmarks, it is really
>> unstable (default settings are not written for micro benchmarks).
> [...]
>> I wrote my own benchmark tool, based on timeit, to ha
On 2012-09-30, at 15:15 , Antoine Pitrou wrote:
> On Sun, 30 Sep 2012 15:10:06 +0200
> Dirkjan Ochtman wrote:
>> On Sun, Sep 30, 2012 at 3:03 PM, Antoine Pitrou wrote:
>>> Can't we simply include the Olson database in Windows installers?
>>
>> We probably can, but the problem is that it's updat
On 2012-10-01, at 17:32 , Terry Reedy wrote:
> On 10/1/2012 10:06 AM, Lennart Regebro wrote:
>
>> Actually, that's not a bad idea. My original idea was to warn if it
>> *was* outdated, but since there is no way to check that, I scratched
>> that idea.
>
> Is there really no way to get a 'last up
On 2012-10-13, at 08:40 , Leo wrote:
> Use this script on a json file and observe all the trailing spaces
> generated. (screenshot attached.)
1. Why didn't you report that on the tracker?
2. Why are you rewriting json.tool?
___
Python-Dev mailing list
P
On 2012-10-31, at 18:44 , anatoly techtonik wrote:
> I wonder why Python uses signed chars for bytes
> http://docs.python.org/2/library/ctypes.html#ctypes.c_byte
That's not Python, that's ctypes. struct[0] has no "bytes" it uses
"char" for everything.
If I had to guess, it would be because "char"
On 2012-11-05, at 10:32 , Ronald Oussoren wrote:
>> My arguments for ctypes:
>> 1. doesn't require compilation
>> 2. easier to maintain (no C/toolchain knowledge/ownership needed)
>> 3. pure Python is impossible to exploit (unlike pure C)
>
> That's not not quite true, python code that uses ctypes
On 2012-11-14, at 17:42 , Richard Oudkerk wrote:
> On 14/11/2012 4:23pm, Serhiy Storchaka wrote:
>> PEP 8 recommends:
>>
>> a_dict = dict(
>> x=1,
>> y=2,
>> z=3,
>> ...
>> )
>>
>> and
>>
>> a_dict = {
>> 'x': 1,
>> 'y': 2,
>> 'z': 3,
>> ...
>> }
>
> In which s
On 2012-11-14, at 18:08 , Mark Adam wrote:
>
> That's not a recommendation to use the **kwargs style.
And nobody said it was. It's a recommendation to not put spaces around
the equals sign when using keyword arguments which is the correction
Serhiy applied to the original code (along with adding
On 2012-11-14, at 18:10 , Mark Adam wrote:
>
> Try the canonical {'x':1}. Only dict allows the special
> initialization above. Other collections require an iterable.
Other collections don't have a choice, because it would often be
ambiguous. Dicts do not have that issue.
> I'm guessing
> **kw
On 2012-11-14, at 19:54 , Mark Adam wrote:
>
> Merging of two dicts is done with dict.update.
No, dict.update merges one dict (or two) into a third one.
> How do you do it on
> initialization? This doesn't make sense.
dict(d1, **d2)
___
Python-Dev ma
On 2012-11-14, at 21:53 , Mark Adam wrote:
> On Wed, Nov 14, 2012 at 1:37 PM, Xavier Morel wrote:
>> On 2012-11-14, at 19:54 , Mark Adam wrote:
>>>
>>> Merging of two dicts is done with dict.update.
>>
>> No, dict.update merges one dict (or two) into a t
On 2012-11-14, at 23:43 , Chris Withers wrote:
> On 14/11/2012 22:37, Chris Withers wrote:
>> On 14/11/2012 10:11, mar...@v.loewis.de wrote:
>>> def xdict(**kwds):
>>> return kwds
>>
>> Hah, good call, this trumps both of the other options:
>>
>> $ python2.7 -m timeit -n 100 -r 5 -v
>> "{
On 2012-11-25, at 18:02 , Oleg Broytman wrote:
> On Sun, Nov 25, 2012 at 01:14:11PM +0100, Matthias Bernt
> wrote:
>> I'm using the logging module and write my log messages via the FileHandler.
>> I just realized that using an external log rotation mechanism does not
>> work. That is, new message
On 2012-11-26, at 07:54 , Nick Coghlan wrote:
> On Mon, Nov 26, 2012 at 3:01 PM, Chris Jerdonek
> wrote:
>
>> I would like to know when we should use "class" in the Python 3
>> documentation, and when we should use "type." Are these terms
>> synonymous in Python 3, and do we have a preference
On 2012-12-12, at 15:12 , Ross Lagerwall wrote:
> On Wed, Dec 12, 2012 at 01:27:21PM +0200, Petri Lehtinen wrote:
>> Brandon W Maister wrote:
>>> (defconst git-tools-grep-command
>>> "git ls-files -z | xargs -0 grep -In %s"
>>> "The command used for grepping files using git. See `git-tools-grep'
On 2013-02-08, at 16:39 , Chris Withers wrote:
> Hi All,
>
> Just had a bit of an embarrassing incident in some code where I did:
>
> sometotal =+ somevalue
>
> I'm curious why this syntax is allowed? I'm sure there are good reasons, but
> thought I'd ask…
sometotal = (expression) is valid s
On 2013-02-08, at 18:45 , Chris Withers wrote:
> On 08/02/2013 16:17, Oscar Benjamin wrote:
>> Decimal.__pos__ uses it to return a Decimal instance that has the
>> default precision of the current Decimal context:
>>
> from decimal import Decimal
> d = Decimal('0.3
On 2013-02-12, at 22:40 , Ned Batchelder wrote:
> But the only reason "".join() is a Python idiom in the first place is because
> it was "the fast way" to do what everyone initially coded as "s += ...".
> Just because we all learned a long time ago that joining was the fast way to
> build a st
On 2013-02-13, at 12:37 , Steven D'Aprano wrote:
>
># even less obvious than sum
>map(operator.add, array)
That one does not work, it'll try to call the binary `add` with each
item of the array when the map iterator is reified, erroring out.
functools.reduce(operator.add, array, '')
On 2013-02-13, at 19:48 , Maciej Fijalkowski wrote:
> Hi
>
> I've tried (and failed) to find what GC details (especially finalizer
> semantics) are CPython only and which ones are not. The best I could
> find was the documentation of __del__ here:
> http://docs.python.org/2/reference/datamodel.ht
101 - 132 of 132 matches
Mail list logo