[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2023-04-29 Thread petr
Ad 4) Wouldn't "<=" be a little more logical than "=>"? The perceived direction of the "flow" of the default value is exactly opposite, i.e., the default value is always evaluated and then put *into* the argument. For example: def bisect_right(a, x, lo=0, hi<=len(a), *, key=None): __

Re: [Python-ideas] Idea: msgfmt.py and pygettext..py should be -m executable modules

2018-07-30 Thread Petr Viktorin
On Mon, Jul 23, 2018 at 2:16 PM, Miro Hrončok wrote: > Currently, the documentation (as well as plenty of other places on the > Internet, such as Stack Overflow answers) mentions msgfmt.py and > pygettext.py. > > See https://docs.python.org/3/library/gettext.html > >> (Python also includes pure-Py

Re: [Python-ideas] Changing optimisation level from a script

2016-09-10 Thread Petr Viktorin
On 09/10/2016 02:04 AM, Damien George wrote: What is to stop you from adding this to micropython as a library extension? That's what I would like to do, and usually we do just go ahead and add our own extensions, trying to be Pythonic as possible :) But we do that a lot and sometimes I think i

Re: [Python-ideas] PEP 540: Add a new UTF-8 mode

2017-01-11 Thread Petr Viktorin
On 01/11/2017 11:46 AM, Stephan Houben wrote: Hi INADA Naoki, (Sorry, I am unsure if INADA or Naoki is your first name...) While I am very much in favour of everything working "out of the box", an issue is that we don't have control over external code (be it Python extensions or external proces

Re: [Python-ideas] globals should accept parenteses for extending beyond 1 line

2017-01-24 Thread Petr Viktorin
On 01/23/2017 10:22 PM, João Matos wrote: Hello, I understand. Python sources are very large. Any pointers to which file defines the global statement syntax? Consider joining the core-mentorship list for questions like these: https://mail.python.org/mailman/listinfo/core-mentorship Anyway, Py

Re: [Python-ideas] pathlib suggestions

2017-01-25 Thread Petr Viktorin
On 01/25/2017 04:04 PM, Todd wrote: On Wed, Jan 25, 2017 at 12:25 AM, Stephen J. Turnbull mailto:turnbull.stephen...@u.tsukuba.ac.jp>> wrote: I'm just going to let fly with the +1s and -1s, don't take them too seriously, they're basically impressionistic (I'm not a huge user of pathl

Re: [Python-ideas] pathlib suggestions

2017-01-25 Thread Petr Viktorin
On 01/25/2017 04:33 PM, Todd wrote: On Wed, Jan 25, 2017 at 10:18 AM, Petr Viktorin mailto:encu...@gmail.com>> wrote: On 01/25/2017 04:04 PM, Todd wrote: On Wed, Jan 25, 2017 at 12:25 AM, Stephen J. Turnbull mailto:turnbull.stephen...@u.tsukuba

Re: [Python-ideas] Exposing CPython's subinterpreter C-API in the stdlib.

2017-05-26 Thread Petr Viktorin
On 05/25/2017 09:01 PM, Eric Snow wrote: On Thu, May 25, 2017 at 11:19 AM, Nathaniel Smith wrote: My impression is that the code to support them inside CPython is fine, but they're broken and not very useful in the sense that lots of C extensions don't really support them, so in practice you ca

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Petr Viktorin
On 10/31/2017 09:54 AM, Koos Zevenhoven wrote: On Tue, Oct 31, 2017 at 10:01 AM, Chris Angelico >wrote: On Tue, Oct 31, 2017 at 6:46 PM, Steven D'Aprano mailto:st...@pearwood.info>> wrote: > On Tue, Oct 31, 2017 at 06:02:34PM +1100, Chris Angelico wrote:

Re: [Python-ideas] venv *is* provided in the standard Python install on Debian/Ubuntu

2017-11-13 Thread Petr Viktorin
On 11/13/2017 11:05 AM, Antoine Pitrou wrote: On Mon, 13 Nov 2017 12:32:06 +1000 Nick Coghlan wrote: On 13 November 2017 at 04:38, Antoine Pitrou wrote: On Sun, 12 Nov 2017 12:20:45 + Paul Moore wrote: Well, not exactly. Do you do python -m venv, or py -x.x -m venv or pythonx -m venv

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-29 Thread Petr Viktorin
On 11/29/2017 08:31 PM, Barry Warsaw wrote: Nathan Schneider wrote: I think it would be interesting to investigate how assert statements are used in the wild. I can think of three kinds of uses: assert statements are also a form of executable documentation. It says something like "I think t

Re: [Python-ideas] Official site-packages/test directory

2018-01-19 Thread Petr Viktorin
FWIW, I've had very good experience with putting tests for package `foo` in a directory/package called `test_foo`. This combines the best of both worlds -- it can be easily separated for distribution (like `tests`), and it doesn't cause name conflicts (like `foo.tests`). On 01/19/2018 05:23

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-19 Thread Petr Viktorin
On 03/19/18 09:17, Stephen J. Turnbull wrote: Nathaniel Smith writes: > Similarly, it's hard to explain why we have Path.mkdir but not > Path.makedirs So what? Let's fix that. As you propose: > (maybe it should be Path.mkdir(include_parents=True) > is fine, although that default seems a

Re: [Python-ideas] Move optional data out of pyc files

2018-04-11 Thread Petr Viktorin
On 04/11/18 06:21, Chris Angelico wrote: On Wed, Apr 11, 2018 at 1:02 PM, Steven D'Aprano wrote: On Wed, Apr 11, 2018 at 10:08:58AM +1000, Chris Angelico wrote: File system limits aren't usually an issue; as you say, even FAT32 can store a metric ton of files in a single directory. I'm more i

Re: [Python-ideas] Move optional data out of pyc files

2018-04-11 Thread Petr Viktorin
On 04/11/18 08:06, Steven D'Aprano wrote: On Wed, Apr 11, 2018 at 02:21:17PM +1000, Chris Angelico wrote: [...] Yes, it will double the number of files. Actually quadruple it, if the annotations and line numbers are in separate files too. But if most of those extra files never need to be open

Re: [Python-ideas] collections.Counter should implement __mul__, __rmul__

2018-04-18 Thread Petr Viktorin
On 04/18/18 17:33, Raymond Hettinger wrote: On Apr 16, 2018, at 5:43 PM, Tim Peters wrote: BTW, if _`Counter * scalar` is added, we should think more about oddball cases. While everyone knows what _they_ mean by "scalar", Python doesn't. I've started working on an implementation and sev

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-05-07 Thread Petr Viktorin
On 05/07/18 11:37, Eloi Gaudry wrote: Hi, I'd like to bring back this discussion (from 2005, by Greg): https://bugs.python.org/issue1229239 Briefly, non-heap types cannot have their attributes changed by Python code. This makes sense for python builtin types, but not for the types defined in ex

[Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Petr Viktorin
Hello, Python 3.7 removes the undocumented internal import `os.errno`. We consider that a an implementation detail, which can be changed *without notice* even in a bugfix release. Projects that depend on it are incorrect and should be fixed. On bpo-33666, there's a debate on whether the remova

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Petr Viktorin
On 05/29/18 13:57, Steven D'Aprano wrote: On Tue, May 29, 2018 at 12:06:42PM +0200, Petr Viktorin wrote: Hello, Python 3.7 removes the undocumented internal import `os.errno`. We consider that a an implementation detail, which can be changed *without notice* even in a bugfix release. Pro

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Petr Viktorin
(Apologies if you received an empty/unfinished e-mail here earlier; I hit Send by mistake.) On 05/29/18 13:57, Steven D'Aprano wrote: On Tue, May 29, 2018 at 12:06:42PM +0200, Petr Viktorin wrote: Hello, Python 3.7 removes the undocumented internal import `os.errno`. We consider that