Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-28 Thread André Malo
* Steven D'Aprano wrote: > On Fri, May 27, 2016 at 04:01:11PM -0700, Guido van Rossum wrote: > > Also -- the most important thing. :-) What to call these things? We're > > pretty much settled on the semantics and how to create them (A = > > NewType('A', int)) but what should we call types like A w

Re: [Python-Dev] Can I make marshal.dumps() slower but stabler?

2018-07-12 Thread André Malo
* INADA Naoki wrote: > Is there any real application which marshal.dumps() performance is > critical? I'm using it for spooling big chunks of data on disk, exactly for the reason that it's faster than pickle. Cheers, -- "Das Verhalten von Gates hatte mir bewiesen, dass ich auf ihn und seine be

Re: [Python-Dev] Can I make marshal.dumps() slower but stabler?

2018-07-13 Thread André Malo
On Donnerstag, 12. Juli 2018 22:09:41 CEST Antoine Pitrou wrote: > On Thu, 12 Jul 2018 22:03:30 +0200 > > André Malo wrote: > > * INADA Naoki wrote: > > > Is there any real application which marshal.dumps() performance is > > > critical? > > > > I&

Re: [Python-Dev] Experiment an opt-in new C API for Python? (leave current API unchanged)

2018-11-13 Thread André Malo
Victor Stinner wrote: > Replacing macros with functions has little impact on backward > compatibility. Most C extensions should still work if macros become > functions. As long as they are recompiled. However, they will lose a lot of performance. Both these points have been mentioned somewhere,

Re: [Python-Dev] Experiment an opt-in new C API for Python? (leave current API unchanged)

2018-11-13 Thread André Malo
Victor Stinner wrote: > Replacing macros with functions has little impact on backward > compatibility. Most C extensions should still work if macros become > functions. As long as they are recompiled. However, they will lose a lot of performance. Both these points have been mentioned somewhere,

Re: [Python-Dev] Experiment an opt-in new C API for Python? (leave current API unchanged)

2018-11-14 Thread André Malo
On Dienstag, 13. November 2018 21:59:14 CET Victor Stinner wrote: > Le mar. 13 nov. 2018 à 20:32, André Malo a écrit : > > As long as they are recompiled. However, they will lose a lot of > > performance. Both these points have been mentioned somewhere, I'm > > certain,

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread André Malo
. nd -- package Hacker::Perl::Another::Just;print qq~@{[reverse split/::/ =>__PACKAGE__]}~; # André Malo # http://pub.perlig.de # ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread André Malo
On Dienstag, 21. Mai 2019 13:24:34 CEST Victor Stinner wrote: > Le mar. 21 mai 2019 à 13:18, André Malo a écrit : > > There's software in production using both. (It doesn't mean it's on pypi > > or even free software). > > > > What would be the maint

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread André Malo
n general (that's not news though :-). And the problem I see there is: There *is* no valid answer. (Sorry if I seem to be just annoying. That's not intended, I'm just not carrying the good news.) nd -- package Hacker::Perl::Another::Just;print qq~@{[reverse split/::/ =>

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread André Malo
On Dienstag, 21. Mai 2019 13:46:34 CEST Christian Heimes wrote: > On 21/05/2019 13.08, André Malo wrote: > > On Montag, 20. Mai 2019 23:27:49 CEST Antoine Pitrou wrote: > >> NNTP is still quite used (often through GMane, but probably not only) > >> so > >>

Re: [Python-Dev] Lambda [was Re: PEP 8 modernisation]

2013-08-01 Thread André Malo
* Stephen J. Turnbull wrote: > Chris Angelico writes: > > On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin wrote: > > > fun = lambda i: i[1] > > > for key, items in groupby(sorted(items, key=fun), key=fun): > > > print(key, ':', list(items)) > > > > I'd do a direct translation to def her

Re: [Python-Dev] When to use EOFError?

2016-06-22 Thread André Malo
* Serhiy Storchaka wrote: > There is a design question. If you read file in some format or with some > protocol, and the data is ended unexpectedly, when to use general > EOFError exception and when to use format/protocol specific exception? > > For example when load truncated pickle data, an unpi

Re: [Python-Dev] When to use EOFError?

2016-06-26 Thread André Malo
* Serhiy Storchaka wrote: > On 22.06.16 19:22, André Malo wrote: > > I often concatenate multiple pickles into one file. When reading them, > > it works like this: > > > > try: > > while True: > > yield pickle.load(fp) > > except EOF

Re: [Python-Dev] Imports with underscores

2017-01-09 Thread André Malo
me the modules steal good names for local variables, underscoring also solved this problem for me. Cheers, nd -- die (eval q-qq:Just Another Perl Hacker :-) # André Malo, <http://pub.perlig.de/> # ___ Python-Dev mailing list Python-Dev@py

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-13 Thread André Malo
Steve Dower wrote: > On 11Apr2020 0025, Antoine Pitrou wrote: > > On Fri, 10 Apr 2020 23:33:28 +0100 > > > > Steve Dower wrote: > >> On 10Apr2020 2055, Antoine Pitrou wrote: > >>> On Fri, 10 Apr 2020 19:20:00 +0200 > >>> > >>> Victor Stinner wrote: > Note: Cython and cffi should be preferr

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-14 Thread André Malo
Steve Dower wrote: > On a policy level, we don't make changes that would break users of the C > API. Because we can't track everyone who's using it, we have to assume > that everything is used and any change will cause breakage. > > To make sure it's possible to keep developing CPython, we decl

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-14 Thread André Malo
Stefan Behnel wrote: > André Malo schrieb am 14.04.20 um 13:39: > > > I think, it does not serve well as a policy for CPython. Since we're > > talking hypotheticals right now, if Cython vanishes tomorrow, we're > > kind of left empty handed. Such kind of a runt

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-14 Thread André Malo
Steve Dower wrote: > On 14Apr2020 1557, André Malo wrote: > > > Stefan Behnel wrote: > > > >> André Malo schrieb am 14.04.20 um 13:39: > >> > >>> A good way to test that promise (or other implications like > >>> performance) >

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-10-03 Thread André Malo
* Steven D'Aprano wrote: > You don't need a comment warning that you are catching SystemExit > because parse_args raises SystemExit, any more than you need a comment > saying that you are catching ValueError because some function raises > ValueError. The fact that you are catching an exception imp

Re: [Python-Dev] Removal of Win32 ANSI API

2010-11-11 Thread André Malo
On Thursday 11 November 2010 20:50:35 Martin v. Löwis wrote: > > Even if I hate the MBCS encoding, because it replaces undecodable > > characters by similar glyphs by default, I'm not certain that it is a > > good idea to drop the bytes API. Can it be a problem to port programs > > from Python2 to

Re: [Python-Dev] datetime module enhancements

2007-03-09 Thread André Malo
* Brett Cannon wrote: > On 3/9/07, Christian Heimes <[EMAIL PROTECTED]> wrote: > > * What do you think about including PyTz in the Python core? PyTz is > > really, REALLY useful when one has to deal with time zones. > > http://pytz.sourceforge.net/ > > What is wrong with datetime's tzinfo objects

Re: [Python-Dev] deprecate commands.getstatus()

2007-03-22 Thread André Malo
* Titus Brown wrote: > On Thu, Mar 22, 2007 at 02:47:58PM -0700, Guido van Rossum wrote: > -> On 3/22/07, Michael Foord <[EMAIL PROTECTED]> wrote: > -> > Guido van Rossum wrote: > -> > > Sure. os.fork() and the os.exec*() family can stay. But > os.spawn*(), -> > > that abomination invented by Micr

Re: [Python-Dev] Remove HTTP 0.9 support

2010-12-16 Thread André Malo
* Antoine Pitrou wrote: > Hello, > > I would like to remove HTTP 0.9 support from http.client and > http.server. I've opened an issue at http://bugs.python.org/issue10711 > for that. Would anyone think it's a bad idea? > > (HTTP 1.0 was devised in 1996) HTTP/0.9 support is still recommended (RFC

Re: [Python-Dev] Remove HTTP 0.9 support

2010-12-16 Thread André Malo
On Thursday 16 December 2010 15:23:05 Antoine Pitrou wrote: > On Thu, 16 Dec 2010 07:42:08 +0100 > > André Malo wrote: > > * Antoine Pitrou wrote: > > > Hello, > > > > > > I would like to remove HTTP 0.9 support from http.client and >

Re: [Python-Dev] Remove HTTP 0.9 support

2010-12-16 Thread André Malo
* Fred Drake wrote: > On Thu, Dec 16, 2010 at 10:52 AM, André Malo wrote: > > I'd vote for removing it from the client code and keeping it in the > > server. > > If it must be maintained anywhere, it should be in the client, > according to the basic principle of &

Re: [Python-Dev] Removing the GIL (Me, not you!)

2007-09-13 Thread André Malo
* Christian Heimes wrote: > Pardon my ignorance but why does Python do reference counting for truly > global and static objects like None, True, False, small and cached > integers, sys and other builtins? If I understand it correctly these > objects are never garbaged collected (at least they sho

Re: [Python-Dev] Should we do away with unbound methods in Py3k?

2007-11-24 Thread André Malo
* Greg Ewing wrote: > Phillip J. Eby wrote: > > class MoneyField(Field): > > # does need staticmethod because two_decimal_places > > # doesn't take a self > > converter = staticmethod(two_decimal_places) > > Okay, I see what you mean now. But you could just as well wrap > it in a funct

Re: [Python-Dev] Backporting PEP 3101 to 2.6

2008-02-16 Thread André Malo
* Nick Coghlan wrote: > Eric Smith wrote: > > The bad error message is a result of __format__ passing on unicode to > > strftime. > > > > There are, of course, various ugly ways to work around this involving > > nested format calls. > > I don't know if this fits your definition of "ugly workaround

Re: [Python-Dev] Backporting PEP 3101 to 2.6

2008-02-17 Thread André Malo
* Eric Smith wrote: > André Malo wrote: > > I guess, a clean and complete solution (besides re-implementing the > > whole thing) would be to resolve each single format character with > > strftime, decode according to the locale and re-assemble the result > > string piec

Re: [Python-Dev] How best to handle the docs for a renamed module?

2008-05-16 Thread André Malo
* M.-A. Lemburg wrote: > On 2008-05-12 04:34, Brett Cannon wrote: > > For the sake of argument, let's consider the Queue module. It is now > > named queue. For 2.6 I plan on having both Queue and queue listed in > > the index, with Queue deprecated with instructions to use the new > > name. > >

Re: [Python-Dev] Possible bug in re module?

2008-05-20 Thread André Malo
* Dmitry Vasiliev wrote: > I've just found a strange re behavior: > >>> import re > >>> re.sub("(?:ab|b|a)", "+", "cbacbabcabc") > > 'c++c++c+c' > > >>> re.sub("(?:ab|b|a){2}", "+", "cbacbabcabc") > > 'c+c+c+c' > > In the last case |-separated expressions seems don't tried from left to > right.

Re: [Python-Dev] Proposal: add odict to collections

2008-06-14 Thread André Malo
* Armin Ronacher wrote: > Some reasons why ordered dicts are a useful feature: > > - in XML/HTML processing it's often desired to keep the attributes of > an tag ordered during processing. So that input ordering is the > same as the output ordering. > > - Form data transmitted via HTT

Re: [Python-Dev] Proposal: add odict to collections

2008-06-15 Thread André Malo
* Guido van Rossum wrote: > On Sat, Jun 14, 2008 at 4:57 PM, André Malo <[EMAIL PROTECTED]> wrote: > > * Armin Ronacher wrote: > >> Some reasons why ordered dicts are a useful feature: > >> > >> - in XML/HTML processing it's often desired to ke

Re: [Python-Dev] urllib.quote and unquote - Unicode issues

2008-07-12 Thread André Malo
* Matt Giuca wrote: > Well from what I've seen, the only time Latin-1 naturally appears on the > net is when you have a web page in Latin-1 (either explicit or inferred; > and note that a browser like Firefox will infer Latin-1 if it sees only > ASCII characters) with a form in it. Submitting the

Re: [Python-Dev] urllib.quote and unquote - Unicode issues

2008-07-13 Thread André Malo
* Matt Giuca wrote: > > This POV is way too browser-centric... > > This is but one example. Note that I found web forms to be the least > clear-cut example of choosing an encoding. Most of the time applications > seem to be using UTF-8, and all the standards I have read are moving > towards specif

Re: [Python-Dev] urllib.quote and unquote - Unicode issues

2008-07-30 Thread André Malo
de compatible by default; unquote is inverse of quote. > Cons: By default, URIs may have invalid octet sequences (not possible > to reverse). Con: URI encoding does not encode characters. > > 3. quote default to UTF-8, unquote default to Latin-1. > In favour: André Malo > Pros

Re: [Python-Dev] urllib.quote and unquote - Unicode issues

2008-08-06 Thread André Malo
* Bill Janssen wrote: > > I'm far less concerned about > > the decision with regards to unquote_to_bytes/quote_from_bytes, as > > those are new features which can wait. > > Forgive me, but those are the *old* features, which must be there. This whole discussion circles too much, I think. Maybe

Re: [Python-Dev] urllib.quote and unquote - Unicode issues

2008-08-06 Thread André Malo
* Matt Giuca wrote: > > This whole discussion circles too much, I think. Maybe it should be > > pepped? > > The issue isn't circular. It's been patched and tested, then a whole lot > of people agreed including Guido. Then you and Bill wanted the bytes > functionality back. So I wrote that in ther

Re: [Python-Dev] Attribute error: providing type name

2008-11-30 Thread André Malo
* Christian Heimes wrote: > Adam Olsen wrote: > > I'm sure you'll get support for this, unless it's a really > > inconvenient spot that requires a gross hack to print the type name. > > Post a patch on the bug tracker. > > So far I can see only one argument against the proposed idea: doc tests. >

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-04 Thread André Malo
* Adam Olsen wrote: > On Thu, Dec 4, 2008 at 1:02 PM, Toshio Kuratomi <[EMAIL PROTECTED]> wrote: > > I opened up bug http://bugs.python.org/issue4006 a while ago and it was > > suggested in the report that it's not a bug but a feature and so I > > should come here to see about getting the featu

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-04 Thread André Malo
* Adam Olsen wrote: > On Thu, Dec 4, 2008 at 2:09 PM, André Malo <[EMAIL PROTECTED]> wrote: > > Here's an example which will become popular soon, I guess: CGI scripts > > and, of course WSGI applications. All those get their environment in an > > unknown encoding

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-06 Thread André Malo
* Nick Coghlan wrote: > Toshio Kuratomi wrote: > > Note 2: If there isn't a parallel API on all platforms, for instance, > > Guido's proposal to not have os.environb on Windows, then you'll still > > have to have a platform specific check. (Likely you should try to > > access os.evironb in this in

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-09 Thread André Malo
* M.-A. Lemburg wrote: > On 2008-12-09 09:41, Anders J. Munch wrote: > > On Sun, Dec 7, 2008 at 3:53 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > try: > files = os.listdir(somedir, errors = strict) > except OSError as e: > log() > files = os.listdir(somedir) > > > > I

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread André Malo
* Adam Olsen wrote: > UTF-8 in percent encodings is becoming a defacto standard. Otherwise > the browser has to display the percent escapes in the address bar, > rather than the intended text. Duh! The address bar should contain the URL, which *is* the intended text. The escapes are there for

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread André Malo
* Adam Olsen wrote: > On Fri, Dec 12, 2008 at 2:11 AM, André Malo wrote: > > * Adam Olsen wrote: > >> UTF-8 in percent encodings is becoming a defacto standard. Otherwise > >> the browser has to display the percent escapes in the address bar, > >> rather than

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread André Malo
* Adam Olsen wrote: > On Fri, Dec 12, 2008 at 9:47 PM, André Malo wrote: > > * Adam Olsen wrote: > >> On Fri, Dec 12, 2008 at 2:11 AM, André Malo wrote: > >> > * Adam Olsen wrote: > >> >> UTF-8 in percent encodings is becoming a defacto standard.

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

2012-03-01 Thread André Malo
On Wednesday 29 February 2012 20:17:05 Raymond Hettinger wrote: > On Feb 27, 2012, at 10:53 AM, Victor Stinner wrote: > > A frozendict type is a common request from users and there are various > > implementations. > > ISTM, this request is never from someone who has a use case. > Instead, it almost

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

2012-03-01 Thread André Malo
On Thursday 01 March 2012 14:07:10 Victor Stinner wrote: > > Here are my real-world use cases. Not for security, but for safety and > > performance reasons (I've built by own RODict and ROList modeled after > > dictproxy): > > > > - Global, but immutable containers, e.g. as class members > > I atta

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

2012-03-01 Thread André Malo
On Thursday 01 March 2012 15:17:35 Serhiy Storchaka wrote: > 01.03.12 11:29, André Malo написав(ла): > > - Caching. My data container objects (say, resultsets from a db or > > something) usually inherit from list or dict (sometimes also set) and are > > cached heavily. In orde

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

2012-03-01 Thread André Malo
On Thursday 01 March 2012 15:54:01 Victor Stinner wrote: > > I'm not sure about your final types. I'm using __slots__ = () for such > > things > > You can still replace an attribute value if a class defines __slots__: > >>> class A: > > ... __slots__=('x',) > ... x = 1 > ... > > >>> A.x=2 > >>

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

2012-03-01 Thread André Malo
* Serhiy Storchaka wrote: > 01.03.12 16:47, André Malo написав(ла): > > On Thursday 01 March 2012 15:17:35 Serhiy Storchaka wrote: > >> This is the first rational use of frozendict that I see. However, a > >> deep copy is still necessary to create the frozendict. Fo

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

2012-03-01 Thread André Malo
* Guido van Rossum wrote: > On Thu, Mar 1, 2012 at 9:44 AM, Victor Stinner wrote: > > frozendict would help pysandbox but also any security Python module, > > not security, but also (many) other use cases ;-) > > Well, let's focus on the other use cases, because to me the sandbox > use case is t

Re: [Python-Dev] Making builtins more efficient

2006-03-09 Thread André Malo
* Paul Moore wrote: > If it *is* possible, I'd say it's worth implementing at least a > warning sooner rather than later - the practice seems questionable at > best, and any progress towards outlawing it would help in work on > optimising builtins. FWIW, this practice is very handy for unit tes

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread André Malo
* Guido van Rossum wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. This should be a > small change. I'm hesitant to propose *anything* new for Python 2.5, > so I'm proposing it for 2.6; if Neal and Anthony think th

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread André Malo
* Guido van Rossum wrote: > On 4/26/06, André Malo <[EMAIL PROTECTED]> wrote: > > * Guido van Rossum wrote: > > > So I have a very simple proposal: keep the __init__.py requirement > > > for top-level pacakages, but drop it for subpackages. This should be >

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread André Malo
* Guido van Rossum wrote: [me] > > Actually I have no problems with the change from inside python, but > > from the POV of tools, which walk through the directories, > > collecting/separating python packages and/or supplemental data > > directories. It's an explicit vs. implicit issue, where impli