[Python-Dev] Re: REPL output bug

2020-06-16 Thread Xavier Morel
> On 16 Jun 2020, at 08:51, Greg Ewing wrote: > > On 16/06/20 12:20 pm, Steven D'Aprano wrote: >> The whole point of the REPL is to evaluate an >> expression and have the result printed. (That's the P in REPL :-) > > Still, it's a bit surprising that it prints results of > expressions within a

Re: [Python-Dev] Compact ordered set

2019-02-28 Thread Xavier Morel
> On 2019-02-28, at 12:56 , Antoine Pitrou wrote: > > On Thu, 28 Feb 2019 22:43:04 +1100 > Steven D'Aprano wrote: >> On Wed, Feb 27, 2019 at 02:15:53PM -0800, Barry Warsaw wrote: >> >>> I’m just relaying a data point. Some Python folks I’ve worked with do >>> make the connection between dict

Re: [Python-Dev] Micro-optimizations by adding special-case bytecodes?

2017-05-24 Thread Xavier Morel
> On 2017-05-24, at 20:26 , Xavier Morel wrote: > >> On 2017-05-24, at 20:07 , Ben Hoyt wrote: >> >> Hi folks, >> >> I was looking at some `dis` output today, and I was wondering if anyone has >> investigated optimizing Python (slightly) by ad

Re: [Python-Dev] Micro-optimizations by adding special-case bytecodes?

2017-05-24 Thread Xavier Morel
> On 2017-05-24, at 20:07 , Ben Hoyt wrote: > > Hi folks, > > I was looking at some `dis` output today, and I was wondering if anyone has > investigated optimizing Python (slightly) by adding special-case bytecodes > for common expressions or statements involving constants? Python 3.6 added

Re: [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

2016-10-10 Thread Xavier Morel
> On 2016-10-10, at 11:05 , Devin Jeanpierre wrote: > The term "borrowed" is supposed to imply a sensible scope during which you're > free to use the object, and weakrefs don't have that (except for what is > granted by the GIL), so this does sound wacky. I bet it was for performance. Especial

Re: [Python-Dev] Bug in the DELETE statement in sqlite3 module

2016-06-15 Thread Xavier Morel
> On 2016-06-15, at 08:40 , ninostephen mathew wrote: > > Respected Developer(s), > while writing a database module for one of my applications in python I > encountered something interesting. I had a username and password field in my > table and only one entry which was "Admin" and "password"

Re: [Python-Dev] [python-committers] How are we merging forward from the Bitbucket 3.5 repo?

2015-08-16 Thread Xavier Morel
On 2015-08-16, at 16:08 , Guido van Rossum wrote: > I presume the issue here is that Hg is so complicated that everyone knows a > different subset of the commands and semantics. > > I personally don't know what the commands for cherry-picking a revision would > be. graft > I also don't know

Re: [Python-Dev] How far to go with user-friendliness

2015-07-14 Thread Xavier Morel
On 2015-07-14, at 14:39 , Nick Coghlan wrote: > On 14 July 2015 at 22:06, Dima Tisnek wrote: >> Thus the question, how far should Python go to detect possible >> erroneous user behaviour? >> >> Granted it is in tests only, but why not detect assrte, sasert, saster >> and assrat? > > Because "

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Xavier Morel
On 2014-11-08, at 20:02 , Ionel Cristian Mărieș wrote: > On Saturday, November 8, 2014, Xavier Morel wrote: > > Why would pathlib need to provide this when tempfile already does? > > with tempfile.NamedTemporaryFile(prefix='') as f: > tmp = path

Re: [Python-Dev] Improvements for Pathlib

2014-11-08 Thread Xavier Morel
On 2014-11-08, at 16:46 , Ionel Cristian Mărieș wrote: > Hello, > > In the current incarnation Pathlib is missing some key features I need in my > usecases. I want to contribute them but i'd like a bit of feedback on the new > api before jumping to implementation. > > The four things I need ar

Re: [Python-Dev] Critical bash vulnerability CVE-2014-6271 may affect Python on *n*x and OSX

2014-09-27 Thread Xavier Morel
On 2014-09-27, at 00:11 , Cameron Simpson wrote: > On 26Sep2014 13:16, Antoine Pitrou wrote: >> On Fri, 26 Sep 2014 01:10:53 -0700 >> Hasan Diwan wrote: >>> On 26 September 2014 00:28, Matěj Cepl wrote: >>> > Where does your faith that other /bin/sh implementations (dash, >>> > busybox, etc.)

Re: [Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Xavier Morel
On 2014-07-07, at 13:22 , Andreas Maier wrote: > While discussing Python issue #12067 > (http://bugs.python.org/issue12067#msg222442), I learned that Python 3.4 > implements '==' and '!=' on the object type such that if no special equality > test operations are implemented in derived classes,

Re: [Python-Dev] Negative timedelta strings

2014-04-02 Thread Xavier Morel
On 2014-04-02, at 15:04 , Skip Montanaro wrote: > On Wed, Apr 2, 2014 at 7:52 AM, M.-A. Lemburg wrote: > print now() + RelativeDateTime(months=+1, day=1) >> 2014-05-01 14:49:05.83 > > I find this sort date arithmetic unintuitive, though I'm at a loss to > come up with better logic than you

Re: [Python-Dev] Negative timedelta strings

2014-03-31 Thread Xavier Morel
On 2014-03-28, at 17:19 , Skip Montanaro wrote: > (*) As an aside (that is, this belongs in a separate thread if you > want to discuss it), in my opinion, attempting to support ISO 8601 > formatting is pointless without the presence of an anchor datetime. > Otherwise how would you know how far bac

Re: [Python-Dev] Reference cycles in Exception.__traceback__

2014-03-06 Thread Xavier Morel
On 2014-03-06, at 19:32 , Guido van Rossum wrote: > But inspect is in the stdlib. Surely changing inspect.py is less > controversial than amending the semantics of frame objects. I've no idea, I'm just giving a case where I could have used the ability to create traceback objects even without the

Re: [Python-Dev] Reference cycles in Exception.__traceback__

2014-03-06 Thread Xavier Morel
On 2014-03-06, at 16:52 , Antoine Pitrou wrote: > Le 06/03/2014 16:03, Yury Selivanov a écrit : >> >> On 2014-03-06, 8:42 AM, Antoine Pitrou wrote: >>> Le 05/03/2014 23:53, Nick Coghlan a écrit : __traceback__ wouldn't change [...] >>> >>> Uh, really? If you want to suppress all refer

Re: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

2014-01-06 Thread Xavier Morel
On 2014-01-06, at 14:44 , Antoine Pitrou wrote: >> Then, >> the following points must be decided to define the complete list of >> supported features (formatters): >> >> * Format integer to hexadecimal? ``%x`` and ``%X`` >> * Format integer to octal? ``%o`` >> * Format integer to binary? ``{!b}``

Re: [Python-Dev] Bug? http.client assumes iso-8859-1 encoding of HTTP headers

2014-01-04 Thread Xavier Morel
On 2014-01-04, at 17:24 , Chris Angelico wrote: > On Sun, Jan 5, 2014 at 2:36 AM, Hugo G. Fierro wrote: >> I am trying to download an HTML document. I get an HTTP 301 (Moved >> Permanently) with a UTF-8 encoded Location header and http.client decodes it >> as iso-8859-1. When there's a non-ASCI

Re: [Python-Dev] PEP 428 - pathlib - ready for approval

2013-11-20 Thread Xavier Morel
On 2013-11-20, at 17:09 , Guido van Rossum wrote: > On Wed, Nov 20, 2013 at 6:01 AM, Ethan Furman wrote: > On 11/20/2013 04:25 AM, Garth Bushell wrote: > > I'm also quite uneasy on the case insensitive comparison on Windows as the > File system NTFS is case sensitive. > > No, it's case-preser

Re: [Python-Dev] Context management patterns

2013-10-19 Thread Xavier Morel
On 2013-10-19, at 08:38 , Nick Coghlan wrote: >> The above example, especially if extended beyond two files, begs to used in >> a loop, like your 5 line version: >> >> >> for name in ("somefile.tmp", "someotherfile.tmp"): >> with suppress(FileNotFoundError): >>os.remove(name

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Xavier Morel
On 2013-10-17, at 22:11 , Ethan Furman wrote: > On 10/17/2013 01:03 PM, Terry Reedy wrote: >> >> class suppress: >> def __init__(self, *exceptions): >> self.exceptions = exceptions >> def __exit__(self, etype, eval, etrace): >> return etype in self.exceptions > > This fails when etyp

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Xavier Morel
On 2013-10-17, at 20:55 , Oscar Benjamin wrote: > On 17 October 2013 19:40, Xavier Morel wrote: >> I think there's already a significant split between context managers >> which handle the lifecycle of a local resource (file, transaction) and >> those which purport t

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Xavier Morel
On 2013-10-17, at 18:06 , Barry Warsaw wrote: > On Oct 18, 2013, at 01:26 AM, Nick Coghlan wrote: >> By contrast, suppress() and redirect_stdout() are the *first* general >> purpose context managers added to contextlib since its incarnation in >> Python 2.5 (although there have been many various do

Re: [Python-Dev] Optimization

2013-10-06 Thread Xavier Morel
On 2013-10-06, at 12:37 , Stephen J. Turnbull wrote: > > For me, the point about string "+=" being efficient (sometimes) isn't > that it is surprising compared to similar types, it's that it is > surprising for any immutable sequence type. It's clearly nitpicking, but ropes are immutable sequenc

Re: [Python-Dev] summing integer and class

2013-10-03 Thread Xavier Morel
On 2013-10-03, at 15:45 , Igor Vasilyev wrote: > Hi. > > Example test.py: > > class A(): >def __add__(self, var): >print("I'm in A class") >return 5 > a = A() > a+1 > 1+a > > Execution: > python test.py > I'm in A class > Traceback (most recent call last): > File "../../te

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Xavier Morel
On 2013-09-29, at 14:51 , 张佩佩 wrote: > Hello: > As far as I know, there is not a language support user defined operator > overloading. > Python3 can overloading belowed operators. > - negated > + unchanged > > - minus > + add > * multiplication > / division > //

Re: [Python-Dev] Best practice for documentation for std lib

2013-09-22 Thread Xavier Morel
On 2013-09-22, at 21:24 , Westley Martínez wrote: >> From: gvanros...@gmail.com [mailto:gvanros...@gmail.com] On Behalf Of Guido >> van Rossum >> Sent: Sunday, September 22, 2013 11:35 AM >> >> You seem to misunderstand the use of "autogeneration". It refers to >> generating >> the .rst docs fr

Re: [Python-Dev] Best practice for documentation for std lib

2013-09-22 Thread Xavier Morel
> On 22 Sep 2013, at 05:25, Benjamin Peterson wrote: > > There's not really much to do but maintain them separately. Truncate > the docstrings if it makes life easier. Autodoc could be enabled and allowed in a limited manner. ___ Python-Dev mailing lis

Re: [Python-Dev] Best practice for documentation for std lib

2013-09-22 Thread Xavier Morel
On 2013-09-22, at 12:16 , Nick Coghlan wrote: > > It's a bit of a pain, and we do occasionally get bug reports where the > docstrings get out of date, but it's the least bad of the currently > available options. Is it really less bad than allowing limited fine-grained use of autodoc? Not necessar

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Xavier Morel
On 2013-09-19, at 23:17 , Nick Coghlan wrote: > On 20 Sep 2013 07:04, "Joe Pinsonault" wrote: >> >> I think it's a great idea personally. It's explicit and obvious. "lamda" > is too computer sciencey > > This suggestion has been made many times, occasionally with the associated > "must be conta

Re: [Python-Dev] DTRACE support

2013-09-06 Thread Xavier Morel
On 2013-09-07, at 05:40 , Jesus Cea wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/09/13 20:33, Antoine Pitrou wrote: >> On Fri, 06 Sep 2013 18:14:26 +0200 Jesus Cea wrote: >>> >>> It is intrusive. Yes. I think it must be, by its own nature. >>> Probably room for improvemen

Re: [Python-Dev] DTRACE support

2013-09-06 Thread Xavier Morel
On 2013-09-06, at 19:05 , Antoine Pitrou wrote: > On Fri, 06 Sep 2013 18:14:26 +0200 > Jesus Cea wrote: >> >>> Right now, I agree with Charles-François: your patch is too >>> intrusive. >> >> It is intrusive. Yes. I think it must be, by its own nature. Probably >> room for improvement and code

Re: [Python-Dev] PEP 435: pickling enums created with the functional API

2013-05-07 Thread Xavier Morel
On 2013-05-07, at 17:03 , Nick Coghlan wrote: > > Specifically, what I'm talking about is some kind of implicit context > similar to the approach the decimal module uses to control operations > on Decimal instances. Wouldn't it be a good occasion to add actual, full-fledged and correctly implemen

Re: [Python-Dev] Why can't I encode/decode base64 without importing a module?

2013-04-25 Thread Xavier Morel
On 2013-04-25, at 11:25 , Antoine Pitrou wrote: > > Besides, I would consider a RFC more authoritative than a > Wikipedia definition. > Base encoding of data is used in many situations to store or transfer > data in environments that, perhaps for legacy reasons, are restricted > to US-ASCII [1] d

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-04 Thread Xavier Morel
On 2013-04-04, at 17:01 , Chris Angelico wrote: > On Fri, Apr 5, 2013 at 1:59 AM, Guido van Rossum wrote: >> On Thu, Apr 4, 2013 at 7:47 AM, Chris Angelico wrote: >>> Is there any argument that I can pass to Foo() to get back a Bar()? >>> Would anyone expect there to be one? Sure, I could overr

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-04 Thread Xavier Morel
On 2013-04-04, at 16:47 , Chris Angelico wrote: > Sure, I could override __new__ to do stupid things Or to do perfectly logical and sensible things, such as implementing "cluster classes" or using the base class as a factory of sorts. > in terms of logical expectations, I'd expect > that Foo(x) w

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-03 Thread Xavier Morel
On 2013-04-03, at 19:46 , Barry Warsaw wrote: > On Apr 04, 2013, at 03:04 AM, Steven D'Aprano wrote: > >> On 04/04/13 01:16, Barry Warsaw wrote: > >>> the other built-in types-as-functions, so int() calls __int__() which must >>> return a concrete integer. > >> Why must it? I think that's the

Re: [Python-Dev] IDLE in the stdlib

2013-03-20 Thread Xavier Morel
On 2013-03-20, at 21:14 , Eli Bendersky wrote: >>> Agreed that the "sync into stdlib" think should not happen, or should at > best be a temporary measure until we can remove idle from the source tarball (maybe at the 3.4 release, otherwise at 3.5). >>> >>> Right. Ultimately, I think

Re: [Python-Dev] IDLE in the stdlib

2013-03-20 Thread Xavier Morel
On 2013-03-20, at 20:59 , Brian Curtin wrote: > On Wed, Mar 20, 2013 at 2:51 PM, Xavier Morel wrote: >> That would be a blow to educators, but also Windows users: while the CLI >> works very nicely in unices, that's not the case with the win32 console >> which is as b

Re: [Python-Dev] IDLE in the stdlib

2013-03-20 Thread Xavier Morel
On 2013-03-20, at 20:38 , Barry Warsaw wrote: > On Mar 20, 2013, at 12:31 PM, Guido van Rossum wrote: > >> Agreed that the "sync into stdlib" think should not happen, or should at >> best be a temporary measure until we can remove idle from the source >> tarball (maybe at the 3.4 release, otherwi

Re: [Python-Dev] can't assign to function call

2013-03-18 Thread Xavier Morel
On 2013-03-18, at 15:23 , Chris Angelico wrote: > On Tue, Mar 19, 2013 at 12:50 AM, Neal Becker wrote: >> def F(x): >>return x >> >> x = 2 >> F(x) = 3 >> >>F(x) = 3 >> SyntaxError: can't assign to function call >> >> Do we really need this restriction? There do exist other languages w

Re: [Python-Dev] Difference in RE between 3.2 and 3.3 (or Aaron Swartz memorial)

2013-03-07 Thread Xavier Morel
On 2013-03-07, at 11:08 , Matej Cepl wrote: > On 2013-03-06, 18:34 GMT, Victor Stinner wrote: >> In short, Unicode was rewritten in Python 3.3 for the PEP 393. It's >> not surprising that minor details like singleton differ. You should >> not use "is" to compare strings in Python, or your program

Re: [Python-Dev] cffi in stdlib

2013-02-27 Thread Xavier Morel
On 2013-02-27, at 14:31 , Antoine Pitrou wrote: > Le Wed, 27 Feb 2013 12:15:05 +1300, > Greg Ewing a écrit : >> Antoine Pitrou wrote: >>> Or we'll go straight to 5. >>> (or switch to date-based numbering :-)) >> >> We could go the Apple route and start naming them after >> species of snake. > >

Re: [Python-Dev] Marking GC details as CPython-only

2013-02-13 Thread Xavier Morel
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

Re: [Python-Dev] Usage of += on strings in loops in stdlib

2013-02-13 Thread Xavier Morel
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, '')

Re: [Python-Dev] Usage of += on strings in loops in stdlib

2013-02-12 Thread Xavier Morel
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

Re: [Python-Dev] why do we allow this syntax?

2013-02-08 Thread Xavier Morel
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

Re: [Python-Dev] why do we allow this syntax?

2013-02-08 Thread Xavier Morel
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

Re: [Python-Dev] Emacs users: hg-tools-grep

2012-12-12 Thread Xavier Morel
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'

Re: [Python-Dev] type vs. class terminology

2012-11-25 Thread Xavier Morel
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

Re: [Python-Dev] logging and rotation

2012-11-25 Thread Xavier Morel
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

Re: [Python-Dev] performance of {} versus dict(), de fmd(**kw): return kw trumps all ; -)

2012-11-14 Thread Xavier Morel
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 >> "{

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Xavier Morel
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

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Xavier Morel
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

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Xavier Morel
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

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Xavier Morel
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

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Xavier Morel
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

Re: [Python-Dev] ctypes is not an acceptable implementation strategy for modules in the standard library?

2012-11-05 Thread Xavier Morel
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

Re: [Python-Dev] Sign of bytes

2012-10-31 Thread Xavier Morel
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"

Re: [Python-Dev] [BUG] Trailing spaces in pretty-printed JSON

2012-10-13 Thread Xavier Morel
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

Re: [Python-Dev] Stdlib and timezones, again

2012-10-01 Thread Xavier Morel
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

Re: [Python-Dev] Stdlib and timezones, again

2012-09-30 Thread Xavier Morel
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

Re: [Python-Dev] 3.3 str timings

2012-08-21 Thread Xavier Morel
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

Re: [Python-Dev] Introduction

2012-08-02 Thread Xavier Morel
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

Re: [Python-Dev] backporting stdlib 2.7.x from pypy to cpython

2012-06-10 Thread Xavier Morel
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

Re: [Python-Dev] Possible rough edges in Python 3 metaclasses (was Re: Language reference updated for metaclasses)

2012-06-05 Thread Xavier Morel
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

Re: [Python-Dev] c/ElementTree XML serialisation

2012-05-08 Thread Xavier Morel
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

Re: [Python-Dev] Add a frozendict builtin type

2012-02-27 Thread Xavier Morel
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

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Xavier Morel
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

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-20 Thread Xavier Morel
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

Re: [Python-Dev] folding cElementTree behind ElementTree in 3.3

2012-02-14 Thread Xavier Morel
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

Re: [Python-Dev] Backwards incompatible sys.stdout.write() behavior in Python 3 (Was: [Python-ideas] Pythonic buffering in Py3 print())

2012-01-13 Thread Xavier Morel
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

Re: [Python-Dev] Backwards incompatible sys.stdout.write() behavior in Python 3 (Was: [Python-ideas] Pythonic buffering in Py3 print())

2012-01-13 Thread Xavier Morel
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://

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Xavier Morel
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

Re: [Python-Dev] cpython (3.2): don't mention implementation detail

2011-12-20 Thread Xavier Morel
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

Re: [Python-Dev] Fixing the XML batteries

2011-12-14 Thread Xavier Morel
On 2011-12-14, at 20:41 , Stefan Behnel wrote: > I meant: "lack of interest in improving them". It's clear from the discussion > that there are still users and that new code is still being written that uses > MiniDOM. However, I would argue that this cannot possibly be performance > critical cod

Re: [Python-Dev] Fixing the XML batteries

2011-12-11 Thread Xavier Morel
On 2011-12-11, at 23:03 , Martin v. Löwis wrote: > People are still using PyXML, despite it's not being maintained anymore. > Telling them to replace 4DOM with minidom is much more appropriate than > telling them to rewrite in ET. >From my understanding, Stefan's suggestion is mostly aimed at "new

Re: [Python-Dev] [PATCH] Adding braces to __future__

2011-12-10 Thread Xavier Morel
On 2011-12-10, at 12:14 , francis wrote: > > (I thing that 'go' has some > autoformater or a standard way of formatting). `gofmt` yes, it simply reformats all the code to match the style decided by the core go team, it does not provide support formatting- independent edition. Think of it as pep8.

Re: [Python-Dev] [PATCH] Adding braces to __future__

2011-12-09 Thread Xavier Morel
On 2011-12-09, at 21:26 , Cedric Sodhi wrote: > IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN > DISCUSSED BEFORE, REPLY THAT "IT'S SIMPLY NOT GO'NNA HAPPEN", THAT "WHO > DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE" OR SOMETHING > SIMILAR, JUST DON'T. > > Otherwise,

Re: [Python-Dev] Fixing the XML batteries

2011-12-09 Thread Xavier Morel
On 2011-12-09, at 19:15 , Bill Janssen wrote: > I use ElementTree for parsing valid XML, but minidom for producing it. Could you expand on your reasons to use minidom for producing XML? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] Fixing the XML batteries

2011-12-09 Thread Xavier Morel
On 2011-12-09, at 09:41 , Martin v. Löwis wrote: >> a) The stdlib documentation should help users to choose the right tool >> right from the start. Instead of using the totally misleading wording >> that it uses now, it should be honest about the performance >> characteristics of MiniDOM and should

Re: [Python-Dev] Deprecation policy

2011-11-28 Thread Xavier Morel
On 2011-11-28, at 13:06 , Nick Coghlan wrote: > On Mon, Nov 28, 2011 at 7:53 PM, Xavier Morel wrote: >> Not being too eager to kill APIs is good, but giving rise to this kind of >> living-dead APIs is no better in my opinion, even more so since Python has >> lost one of th

Re: [Python-Dev] Deprecation policy

2011-11-28 Thread Xavier Morel
On 2011-11-28, at 10:30 , Raymond Hettinger wrote: > On Oct 24, 2011, at 5:58 AM, Ezio Melotti wrote: > How about we agree that actually removing things is usually bad for users. > It will be best if the core devs had a strong aversion to removal. > Instead, it is best to mark APIs as obsolete with

Re: [Python-Dev] Long term development external named branches and periodic merges from python

2011-11-24 Thread Xavier Morel
On 2011-11-24, at 21:55 , Nick Coghlan wrote: > I've never been able to get the Create Patch button to work reliably with > my BitBucket repo, so I still just run "hg diff -r default" locally and > upload the patch directly. Wouldn't it be simpler to just use MQ and upload the patch(es) from the se

Re: [Python-Dev] Promoting Python 3 [was: PyPy 1.7 - widening the sweet spot]

2011-11-22 Thread Xavier Morel
On 2011-11-23, at 04:51 , Stephen J. Turnbull wrote: > Xavier Morel writes: >> On 2011-11-22, at 17:41 , Stephen J. Turnbull wrote: >>> Barry Warsaw writes: > >>>> Hopefully, we're going to be making a dent in that in the next version of >>>> Ubu

Re: [Python-Dev] Promoting Python 3 [was: PyPy 1.7 - widening the sweet spot]

2011-11-22 Thread Xavier Morel
On 2011-11-22, at 17:41 , Stephen J. Turnbull wrote: > Barry Warsaw writes: >> Hopefully, we're going to be making a dent in that in the next version of >> Ubuntu. > > This is still a big mess in Gentoo and MacPorts, though. MacPorts > hasn't done anything about ceating a transition infrastructur

Re: [Python-Dev] order of Misc/ACKS

2011-11-12 Thread Xavier Morel
On 2011-11-12, at 10:24 , Georg Brandl wrote: > Am 12.11.2011 08:03, schrieb Stephen J. Turnbull: >> Eli Bendersky writes: >> >>> special locale. It makes me wonder whether it's possible to have a >>> contradiction in the ordering, i.e. have a set of names that just >>> can't be sorted in any orde

Re: [Python-Dev] Hg tips

2011-09-29 Thread Xavier Morel
On 2011-09-29, at 12:50 , Victor Stinner wrote: > Le 29/09/2011 12:34, Xavier Morel a écrit : >> Generally none. By default, mercurial (and most similar tools) sets up >> LOCAL, BASE and OTHER. BASE is the... > > Sorry, but I'm unable to remember the meaning of LOCAL,

Re: [Python-Dev] Hg tips

2011-09-29 Thread Xavier Morel
On 2011-09-29, at 12:07 , Victor Stinner wrote: > > * I disabled the merge GUI: I lose a lot of work because I'm unable to use a > GUI to do merge, I don't understand what are the 3 versions of the same file > (which one is the merged version!?) Generally none. By default, mercurial (and most si

Re: [Python-Dev] Heads up: Apple llvm gcc 4.2 miscompiles PEP 393

2011-09-28 Thread Xavier Morel
On 2011-09-28, at 19:49 , Martin v. Löwis wrote: > > Thanks for the advise - I didn't expect that Apple ships thhree compilers… Yeah I can understand that, they're in the middle of the transition but Clang is not quite there yet so... ___ Python-Dev mai

Re: [Python-Dev] Heads up: Apple llvm gcc 4.2 miscompiles PEP 393

2011-09-28 Thread Xavier Morel
On 2011-09-28, at 13:24 , mar...@v.loewis.de wrote: > The gcc that Apple ships with the Lion SDK (not sure what Xcode version that > is) Xcode 4.1 > I'm not aware of a work-around in the code. My work-around is to use gcc-4.0, > which is still available on my system from an earlier Xcode installa

Re: [Python-Dev] range objects in 3.x

2011-09-23 Thread Xavier Morel
On 2011-09-23, at 20:23 , Guido van Rossum wrote: > Also, Ethan, I hope you're familiar with the reason why there is no > range() support for floats currently? (Briefly, things like range(0.0, > 0.8, step=0.1) could include or exclude the end point depending on > rounding, which makes for troubleso

Re: [Python-Dev] PEP 393 Summer of Code Project

2011-08-23 Thread Xavier Morel
On 2011-08-23, at 10:55 , Martin v. Löwis wrote: >> - “The UTF-8 decoding fast path for ASCII only characters was removed >> and replaced with a memcpy if the entire string is ASCII.” >> The fast path would still be useful for mostly-ASCII strings, which >> are extremely common (unless UTF-8 ha

Re: [Python-Dev] GIL removal question

2011-08-12 Thread Xavier Morel
On 2011-08-12, at 20:59 , Sturla Molden wrote: > Den 12.08.2011 18:51, skrev Xavier Morel: >> * Erlang uses "erlang processes", which are very cheap preempted *processes* >> (no shared memory). There have always been tens to thousands to millions of >> erlang p

Re: [Python-Dev] GIL removal question

2011-08-12 Thread Xavier Morel
On 2011-08-11, at 21:11 , Sturla Molden wrote: > > (b) another threading model (e.g. one interpreter per thread, as in Tcl, > Erlang, or .NET app domains). Nitpick: this is not correct re. erlang. While it is correct that it uses "another threading model" (one could even say "no threading model

Re: [Python-Dev] PEP 3154 - pickle protocol 4

2011-08-12 Thread Xavier Morel
On 2011-08-12, at 12:58 , Antoine Pitrou wrote: > Current protocol versions export object sizes for various built-in types > (str, bytes) as 32-bit ints. This forbids serialization of large data > [1]_. New opcodes are required to support very large bytes and str > objects. How about changing obje

Re: [Python-Dev] Python 3.x and bytes

2011-05-19 Thread Xavier Morel
On 2011-05-19, at 11:25 , Łukasz Langa wrote: > Wiadomość napisana przez Stefan Behnel w dniu 2011-05-19, o godz. 10:37: > >>> But why wouldn't "they" expect `b'de' + 1` to work as well in this case? If >>> a 1-byte bytes is equivalent to an integer, why not an arbitrary one as >>> well? >> >>

Re: [Python-Dev] Python 3.x and bytes

2011-05-19 Thread Xavier Morel
On 2011-05-19, at 09:49 , Nick Coghlan wrote: > On Thu, May 19, 2011 at 5:10 AM, Eric Smith wrote: >> On 05/18/2011 12:16 PM, Stephen J. Turnbull wrote: >>> Robert Collins writes: >>> >>> > Its probably too late to change, but please don't try to argue that >>> > its correct: the continued conf

Re: [Python-Dev] Python 3.x and bytes

2011-05-19 Thread Xavier Morel
On 2011-05-19, at 07:28 , Georg Brandl wrote: > On 19.05.2011 00:39, Greg Ewing wrote: >> Ethan Furman wrote: >> >>> some_var[3] == b'd' >>> >>> 1) a check to see if the bytes instance is length 1 >>> 2) a check to see if >>> i) the other object is an int, and >>> 2) 0 <= other_obj < 256 >>>

Re: [Python-Dev] Linus on garbage collection

2011-05-07 Thread Xavier Morel
On 2011-05-07, at 03:39 , Glyph Lefkowitz wrote: > > I don't know if there's a programming language and runtime with a real-time, > VM-cooperating garbage collector that actually exists today which has all the > bells and whistles required to implement an OS kernel, so I wouldn't give the > Lin

  1   2   >