Re: [Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-24 Thread Victor Stinner
Hum, I found issues with libpython: C extensions are explicitly linked to libpython built in release mode. So a debug python loading a C extension may load libpython in release mode, whereas libpython in debug mode is already loaded. When Python is built with --enable-shared, the python3.7 program

Re: [Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-25 Thread Victor Stinner
Hi, I'm now convinced that C extensions must *not* be linked to libpython on Unix. I wrote PR 12946: https://github.com/python/cpython/pull/12946 bpo-21536: C extensions are no longer linked to libpython On Unix, C extensions are no longer linked to libpython. It is now possible to

Re: [Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-25 Thread Victor Stinner
Le jeu. 25 avr. 2019 à 09:30, Matthias Klose a écrit : > the purpose of python-config here is not clear. Whether it's intended to be > used > for linking extensions, or embedded interpreters. Currently you are using the > same for both use cases. My PR 12946 removes libpython from distutils, pyt

Re: [Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-25 Thread Victor Stinner
Le jeu. 25 avr. 2019 à 09:34, Matthias Klose a écrit : > there's a simple solution: apt install python3-numpy-dbg cython3-dbg ;) So > depending on the package maintainer, you already have that available, but it > is > extra maintenance cost. Simplifying that would be a good idea. Fedora provid

Re: [Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-25 Thread Victor Stinner
don't know if it's common that C extensions are built using pkg-config. I guess that distutils is more commonly used to build C extensions. Victor Le jeu. 25 avr. 2019 à 12:53, Victor Stinner a écrit : > Le jeu. 25 avr. 2019 à 09:30, Matthias Klose a écrit : > > the purpose

[Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-28 Thread Victor Stinner
FYI I pushed my 3 changes to implement my idea. It is now possible to install some extensions in release mode and some others in debug mode. Python in debug mode prefers debug extensions. I documented changes here: https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-relea

Re: [Python-Dev] datetime.fromisocalendar

2019-04-29 Thread Victor Stinner
I reviewed and merged Paul's PR. I concur with Guido, the new constructor perfectly makes sense and is useful. About the implementation: date and time are crazy beasts. Extract of the code: if not 0 < week < 53: out_of_range = True if week == 53: #

Re: [Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode

2019-04-29 Thread Victor Stinner
You have my support is you work on removing static types :-) Here are my notes on the current C APIs to define a type: https://pythoncapi.readthedocs.io/type_object.html IMHO static types should go away in the long term. They are causing too many practical issues. Victor Le mar. 30 avr. 2019 à

Re: [Python-Dev] "if __name__ == '__main__'" at the bottom of python unittest files

2019-05-01 Thread Victor Stinner
Le mer. 1 mai 2019 à 03:12, Chris Withers a écrit : > Right, but that's not the documented way of running individual suites in > the devguide. Maybe, but I'm using that sometimes and it's useful for some specific issues. Is it possible to run an individual test file using unittest? Something lik

[Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version

2019-05-02 Thread Victor Stinner
; } The HTML version will be online shortly: https://www.python.org/dev/peps/pep-0587/ Full text below. Victor PEP: 587 Title: Python Initialization Configuration Author: Nick Coghlan , Victor Stinner Discussions-To: python-dev@python.org Status: Draft Type: Standards Track Content-Type: text/x

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version

2019-05-02 Thread Victor Stinner
Le jeu. 2 mai 2019 à 16:20, Edwin Zimmerman a écrit : > > ``-c COMMAND````run_module = COMMAND`` > should read "run_command = COMMAND". Typo, not? Oops, you're right: it's a typo. Now fixed: ``-c COMMAND````run_command = COMMAND`` Victor -- Night gather

Re: [Python-Dev] Please merge : bpo-34848

2019-05-03 Thread Victor Stinner
Hi Srinivas, I merged your obvious doc fix, thanks. Does someone know how I can list pull requests which has been approved but not merged yet? Victor Le vendredi 3 mai 2019, Srinivas Reddy Thatiparthy < thatiparthysreeni...@gmail.com> a écrit : > Hi, >The PR - https://github.com/python/cpyt

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version

2019-05-04 Thread Victor Stinner
年5月3日(金) 4:59 Victor Stinner : >> >> * PyConfig now only uses wchar_t* for strings (unicode): char* (bytes) >> is no longer used. I had to hack CPython internals for that :-) > > I prefer char* to wchar_t* on Unix. Since UTF-8 dominated Unix world > in these decades,

Re: [Python-Dev] Stable ABI or not for PyTypeObject?

2019-05-06 Thread Victor Stinner
PyType_FromSpec() looks like a better approach for ABI compatibility. My notes on types and ABI: https://pythoncapi.readthedocs.io/type_object.html Victor Le lun. 6 mai 2019 à 09:57, Jeroen Demeyer a écrit : > > Hello, > > I have a simple question for which there doesn't seem to be a good > answ

Re: [Python-Dev] Hello

2019-05-07 Thread Victor Stinner
Welcome Ben! Le mar. 7 mai 2019 à 16:28, Ben Kane a écrit : > My name is Ben Kane. I'm joining this mailing list and introducing myself as > asked in the "welcome to python-dev" email. I've been using Python for maybe > 7 years now. I started to learn it in college to help with accounting > ho

Re: [Python-Dev] PEP 574 ready for review

2019-05-07 Thread Victor Stinner
You can do it. I like when the acceptance email is linked from the PEP ;-) Victor Le mar. 7 mai 2019 à 14:12, Antoine Pitrou a écrit : > > > Should I submit a PR to change the PEP status or would you like to do > it? > > Regards > > Antoine. > > > On Wed, 1 May 2019 12:49:24 -0700 > Nick Coghlan

Re: [Python-Dev] Adding a tzidx cache to datetime

2019-05-09 Thread Victor Stinner
Hi Paul, The change is basically an optimization. I'm uncomfortable to design it "only" for dateutil. What if tomorrow someone has to store an arbitrary Python object, rather than just an integer (in range [0; 254]), into a datetime for a different optimization? Moreover, I dislike adding a *publ

Re: [Python-Dev] Redoing failed PR checks

2019-05-09 Thread Victor Stinner
Hi, Le mer. 8 mai 2019 à 16:10, Mark Shannon a écrit : > How do I redo a failed PR check? > The appveyor failure for https://github.com/python/cpython/pull/13181 > appears to be spurious, but there is no obvious way to redo it. First, please make sure that a test failure is known in the bug trac

Re: [Python-Dev] Please merge : bpo-34848

2019-05-09 Thread Victor Stinner
Le ven. 3 mai 2019 à 17:47, Jeroen Demeyer a écrit : > On 2019-05-03 14:24, Victor Stinner wrote: > > Hi Srinivas, > > > > I merged your obvious doc fix, thanks. > > Can you please do the same for > > https://github.com/python/cpython/pull/12784 This PR is mody

Re: [Python-Dev] Please merge : bpo-34848

2019-05-09 Thread Victor Stinner
Le ven. 3 mai 2019 à 17:47, Jeroen Demeyer a écrit : > > On 2019-05-03 14:24, Victor Stinner wrote: > > Hi Srinivas, > > > > I merged your obvious doc fix, thanks. > > Can you please do the same for > https://github.com/python/cpython/pull/12784 This PR is modyin

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version

2019-05-10 Thread Victor Stinner
Hi, First of all, I just found an old issue that we will solved by my PEP 587 :-) Add Py_SetFatalErrorAbortFunc: Allow embedding program to handle fatal errors https://bugs.python.org/issue30560 I studied code of applications embedding Python. Most of them has to decode bytes strings to get wcha

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version

2019-05-13 Thread Victor Stinner
)Le lun. 13 mai 2019 à 18:28, Steve Dower a écrit : > My take: > * all the examples are trying to be isolated from the system Python > install (except Vim?) "Isolation" means different things: * ignore configuration files * ignore environment variables * custom path configuration (sys.path, sys.

Re: [Python-Dev] Adding a tzidx cache to datetime

2019-05-13 Thread Victor Stinner
Le ven. 10 mai 2019 à 09:22, M.-A. Lemburg a écrit : > Given that many datetime objects in practice don't use timezones > (e.g. in large data stores you typically use UTC and naive datetime > objects), I think that making the object itself larger to accommodate > for a cache, which will only be us

Re: [Python-Dev] PEP 581 (Using GitHub issues for CPython) is accepted

2019-05-14 Thread Victor Stinner
Congrats Mariatta :-) Victor Le mer. 15 mai 2019 à 03:14, Barry Warsaw a écrit : > > As the BDFL-Delegate for PEP 581, and with the unanimous backing of the rest > of the Steering Council, I hereby Accept this PEP. > > We would like to thank Mariatta for championing PEP 581, and to all the > c

Re: [Python-Dev] PEP 581 (Using GitHub issues for CPython) is accepted

2019-05-15 Thread Victor Stinner
Le mer. 15 mai 2019 à 11:31, Christian Heimes a écrit : > What are the next step? Will there be another PEP that explores how we > are going to deal with migration, workflow changes, and how we plan to > map current BPO features to Github? Yes, it's the: PEP 588 -- GitHub Issues Migration Plan h

Re: [Python-Dev] Adding a toml module to the standard lib?

2019-05-15 Thread Victor Stinner
H Bastian, IMHO we should wait until the format reach version 1.0, since the stdlib has a slow release cycle (one release every 18 months). Too slow for a "fast moving" standard. In the meanwhile, I'm sure setuptools and pip will manage to install a toml parser/generator for their needs, as they

Re: [Python-Dev] [python-committers] PEP 581 (Using GitHub issues for CPython) is accepted

2019-05-15 Thread Victor Stinner
Hi Paul, Le mer. 15 mai 2019 à 11:40, Paul Moore a écrit : > Also, is there an archive of the discussions anywhere? The PEP says > discussions happened on Zulip, but I don't follow that and I don't > know where I can find an archived copy of the discussions. Well, the PEP has been discussed a lot

Re: [Python-Dev] PEP 581 (Using GitHub issues for CPython) is accepted

2019-05-15 Thread Victor Stinner
Le mer. 15 mai 2019 à 20:46, Guido van Rossum a écrit : > But trust me that the SC didn't take this decision lightly. It was unanimous, > and we have all thought about this a great deal (and listened to long > arguments pro and con). It's also impossible to satisfy everyone -- some > people fin

[Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 3rd version

2019-05-15 Thread Victor Stinner
nixMain() to Py_BytesMain() HTML version: https://www.python.org/dev/peps/pep-0587/ Full PEP text below. I know that the PEP is long, but well, it's a complex topic, and I chose to add many examples to make the API easier to understand. Victor --- PEP: 587 Title: Python Initialization Config

[Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-15 Thread Victor Stinner
Hi, I recently modified Python 3.8 to start logging I/O error in io destructors when using the development mode (-X dev) or when Python is built in debug mode. This change allows to debug bpo-18748 very strange crash in PyThread_exit_thread(), when a thread closes an arbitrary file descriptor by m

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 04:44, Nathaniel Smith a écrit : > What happens if the hook raises an exception? Aha, thanks for asking the question! If there is a custom hook and the hook fails, the default hook logs the exception of the custom hook. Technically, even if the default hook fails, the defa

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 08:39, Serhiy Storchaka a écrit : > > 16.05.19 04:23, Victor Stinner пише: > > The first implementation of my API used sys.unraisablehook(exc_type, > > exc_value, exc_tb, obj). The problem is that Serhiy Storchaka asked me > > to add a new error me

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 3rd version

2019-05-16 Thread Victor Stinner
(Le jeu. 16 mai 2019 à 06:34, Gregory Szorc a écrit : > > I know that the PEP is long, but well, it's a complex topic, and I > > chose to add many examples to make the API easier to understand. > > I saw your request for feedback on Twitter a few days back and found > this thread. > > This PEP is

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 12:57, Serhiy Storchaka a écrit : > > For unraisable hook, it's not hard to imagine other useful parameters > > that can be passed to the hook to provide more context about the > > exception. For example, right now we only pass one object. But there > > are cases where a seco

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 3rd version

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 16:10, Thomas Wouters a écrit : >> Would you be ok with a "PyConfig_Init(PyConfig *config);" function >> which would initialize all fields to theire default values? Maybe >> PyConfig_INIT should be renamed to PyConfig_STATIC_INIT. >> >> You can find a similar API for pthread

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
> While I’m fine with the API you propose, you could consider keyword-only arguments to help future proof the call signature. I don’t like it as much because it’s not as backward compatibility proof, but it’s an option to perhaps consider. Let's say that we have: hook(*, exc_type, exc_value, exc_

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 20:58, Petr Viktorin a écrit : > I always thought the classic (exc_type, exc_value, exc_tb) triple is a > holdover from older Python versions, and all the information is now in > the exception instance. > Is the triple ever different from (type(exc), exc, exc.__traceback__)?

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 17:56, Steve Dower a écrit : > I really like this API, and I agree with Victor that we don't really > need more than the exception info. For future expansion, we can pass in > a different exception, no? Sorry, I don't understand. I explained that we need more than (exc_type,

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 23:17, Steve Dower a écrit : > You go on to say "pass an error message" and "keep repr(obj) if you > want", but how is this different from creating an exception that > contains the custom message, the repr of the object, and chains the > exception that triggered it? Well, "u

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 23:46, Nathaniel Smith a écrit : > A clever hook might want the actual object, so it can pretty-print it, > or open an interactive debugger and let it you examine it, or > something. Morally this is similar to calling repr(obj), but it > doesn't literally call repr(obj). Goo

Re: [Python-Dev] Parser module in the stdlib

2019-05-16 Thread Victor Stinner
Le jeu. 16 mai 2019 à 23:15, Pablo Galindo Salgado a écrit : > The parser module has been "deprecated" (technically we recommend to prefer > the ast module instead) since Python2.5 but is still in the standard library. Importing it doesn't emit a DeprecationgWarning. It's only deprecated in the

Re: [Python-Dev] bpo-36829: Add sys.unraisablehook()

2019-05-16 Thread Victor Stinner
Le ven. 17 mai 2019 à 03:10, Gregory P. Smith a écrit : > I like the feature, we should have it. It'll be useful for debugging and > probably more. > > Which brings me to the annoying paint color question: These exceptions were > most definitely raised. Thus the term "unraisable" is wrong. I be

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 3rd version

2019-05-20 Thread Victor Stinner
Hi Gregory, IMHO your remarks are not directly related to the PEP 587 and can be addressed in parallel. > It sounds like PyOxidizer and Hermetic Python are on the same page and > we're working towards a more official solution. But I want to make sure > by explicitly stating what PyOxidizer is doi

[Python-Dev] PEP 587 "Python Initialization Configuration" version 4

2019-05-20 Thread Victor Stinner
peps/pep-0587/ Full text below. Victor PEP: 587 Title: Python Initialization Configuration Author: Victor Stinner , Nick Coghlan BDFL-Delegate: Thomas Wouters Discussions-To: python-dev@python.org Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 27-Mar-2019 Python-Version

Re: [Python-Dev] Plan to accept PEP 544, PEP 586, PEP 589, PEP 591 -- last call for discussion

2019-05-20 Thread Victor Stinner
FYI, copy of Guido's message: --- I'm planning to accept the following PEPs related to the type system later this week: PEP 544: Protocols PEP 586: Literal Types PEP 591: Final qualifier and @final decorator PEP 589: TypedDict All of these have been proposed for and discussed before. All of thes

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

2019-05-21 Thread Victor Stinner
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 maintenance burden of those modules anyway? (at least for > nntp, I guess it's not gonna change). The maintenance burden is

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

2019-05-21 Thread Victor Stinner
Hi Christian, I dislike the PEP 594 title: "Removing dead batteries from the standard library". A module is never "dead", there are always users, even if there are less than 5 of them. Extract of the Rationale: "The modules are mostly historic data formats and APIs that have been superseded a lon

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

2019-05-21 Thread Victor Stinner
IMHO we should simply acknowledge this fact by mentioning it in the PEP. We are aware that "pip install" is not always a valid option, but we decided anyway to deprecate/remove modules because <...>. Victor Le mar. 21 mai 2019 à 15:29, Paul Moore a écrit : > > On Tue, 21 May 2019 at 14:03, Steve

[Python-Dev] Unrelated PRs linked to issues on bugs.python.org

2019-05-21 Thread Victor Stinner
Hi, Since one or two weeks, I noticed that the bot which links GitHub pull requests to bugs.python.org issues started to link PRs to unrelated issues. Example: https://github.com/python/cpython/pull/13148 (merged 2 hours ago) just added to https://bugs.python.org/issue35363 (closed at the end of

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

2019-05-21 Thread Victor Stinner
Le mar. 21 mai 2019 à 23:05, Nathaniel Smith a écrit : > If the tests don't work and the module is unmaintained, then maybe we > should disable the tests and put a prominent notice in the docs saying > that it's unmaintained and any use is at your own risk. It's not a > pleasant thing to do, but i

Re: [Python-Dev] Parser module in the stdlib

2019-05-21 Thread Victor Stinner
Le ven. 17 mai 2019 à 00:44, Nathaniel Smith a écrit : > Will the folks using forks be happy to switch to the stdlib version? > For example I can imagine that if black wants to process 3.7 input > code while running on 3.6, it might prefer a parser on PyPI even if > the stdlib version were public,

Re: [Python-Dev] PEP 587 "Python Initialization Configuration" version 4

2019-05-21 Thread Victor Stinner
Hi, Le lun. 20 mai 2019 à 21:36, Antoine Pitrou a écrit : > - Since PyInitError can be "ok", I'd rather call it "PyInitStatus". Oh, I like this name :-) By the way, I'm not comfortable with "PyInitError_Failed()" name since it's true if it's an error (failure) ... or "an exit". What do you thin

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-24 Thread Victor Stinner
Le ven. 24 mai 2019 à 09:41, Inada Naoki a écrit : > For the record, result for 10M nodes, Ubuntu 18.04 on AWS r5a.4xlarge: > > $ local/bin/python3 t1.py # default > 1138.1123778309993 -- end train, start del > 688.7927911250008 -- end > > $ arena-1m/bin/python3 t1.py # Changed ARENA_SIZE to 1Mi

Re: [Python-Dev] Accepting PEP 587 (Python Initialization Configuration)

2019-05-27 Thread Victor Stinner
Hi, Thanks Thomas for accepting my PEP :-) Thanks everyone who was involved in discussions since it started July 2018! For the first version of my PEP 587, I tried to design an API as small as possible, but it was clear that it didn't fit all use cases. Slowly, I extended and adjusted the API to

Re: [Python-Dev] Expected stability of PyCode_New() and types.CodeType() signatures

2019-06-02 Thread Victor Stinner
Le vendredi 31 mai 2019, Simon Cross a écrit : > As the maintainer of Genshi, ... > The new CodeType.replace will remove some potential sources of breakages in the future, so thank you very much for adding that. Hi Simon, You're welcome :-) Genshi was one of my motivation to add CodeType.replace

Re: [Python-Dev] Recent buildbot reports and asyncio test failures

2019-06-03 Thread Victor Stinner
Many tests are failing randomly on buildbots. *MANY* failures: "test_asyncio: test_cancel_gather_2() dangling thread" https://bugs.python.org/issue37137 Some failures on specific buildbots. multiprocessing does crash randomly on Windows: https://bugs.python.org/issue37143 and on FreeBSD: ht

Re: [Python-Dev] Recent buildbot reports and asyncio test failures

2019-06-03 Thread Victor Stinner
7146 INADA-san worked around this issue by disabling the new opcode cache (LOAD_GLOBAL optimization) when Python is compiled in debug mode. We should try to find a more long term solution after beta1 release. Le lun. 3 juin 2019 à 17:05, Victor Stinner a écrit : > *MANY* failu

Re: [Python-Dev] PEP 594: update 1

2019-06-04 Thread Victor Stinner
So what is happening for this PEP since Python 3.8 beta1 has been released? Is it too late for Python 3.8 or not? It seems like most people are confused by the intent of the PEP. IMHO it would be better to rewrite "Remove packages from the stdlib" as "Move some stdlib modules to PyPI". But that wo

[Python-Dev] python-ideas and python-dev migrated to Mailman 3/HyperKitty

2019-06-05 Thread Victor Stinner
Hi, Our kind postmasters Mark Sapiro and Abhilash Raj migrated python-ideas and python-dev mailing lists from Mailman 2 to Mailman 3 (running on Python 3 ;-))! You can now enjoy HyperKitty, the new web UI to access the mailing lists: https://mail.python.org/archives/list/python-dev@python.org/

[Python-Dev] Re: python-ideas and python-dev migrated to Mailman 3/HyperKitty

2019-06-06 Thread Victor Stinner
Le jeu. 6 juin 2019 à 14:18, Steven D'Aprano a écrit : > i.e. 25-40% longer. Is there a shorter permalink form available, like > goo.gl, bitly, youtu.be etc use? That would be awesome if we could use > them instead. I really dislike URL shorteners. From my point of view, URL shorteners are the o

[Python-Dev] Re: python-ideas and python-dev migrated to Mailman 3/HyperKitty

2019-06-07 Thread Victor Stinner
I am not sure that we are good at archiving. Example with Subversion links in the bug tracker: https://bugs.python.org/issue2001#msg123254 "Added the missing CSS file in r86971." The revision link is: https://hg.python.org/lookup/r86971 Which redirects to the following HTTP 404 (not found) erro

[Python-Dev] Re: Expected stability of PyCode_New() and types.CodeType() signatures

2019-06-11 Thread Victor Stinner
Update. Le ven. 31 mai 2019 à 10:49, Petr Viktorin a écrit : > PEP 570 (Positional-Only Parameters) changed the signatures of > PyCode_New() and types.CodeType(), adding a new argument for "posargcount". Pablo proposed a PR to revert PyCode_New() API to Python 3.7 API: https://github.com/python/

[Python-Dev] Re: Expected stability of PyCode_New() and types.CodeType() signatures

2019-06-12 Thread Victor Stinner
eld to PyConfig structure to prepare the structure to future extension, but keep backward compatibility. The structure will be versionned ;-) Victor Le jeu. 13 juin 2019 à 01:08, Antoine Pitrou a écrit : > > On Wed, 12 Jun 2019 00:09:10 +0200 > Victor Stinner wrote: > > Update.

[Python-Dev] Re: Parser module in the stdlib

2019-06-13 Thread Victor Stinner
Le 16/05/2019 à 23:12, Pablo Galindo Salgado a écrit : > I propose to remove the current parser module and expose pgen2 as a > standard library module. As a first step, I created https://bugs.python.org/issue37268 to propose to deprecate the parser module already in Python 3.8. Victor

[Python-Dev] Re: Documenting METH_FASTCALL

2019-06-13 Thread Victor Stinner
Hi Jeroen, My initial plan was to hide it to ensure that nobody uses it, wait until the code and the API is battle-tested, and then propose a public API. I was a good idea to not make it public in the first place, since Python 3.7 modified FASTCALL deeply to not include keyword parameters by

[Python-Dev] Re: PyAPI_FUNC() is needed to private APIs?

2019-06-13 Thread Victor Stinner
Hi, Le 13/06/2019 à 15:05, Inada Naoki a écrit : Some functions in cpython are private. These APIs are called from only python executable or DLL. They are not called even from extension modules in stdlib. Python 3.8 now has a better separation between "private" and "internal" APIs: * priva

[Python-Dev] Re: _Py_Identifier should support non-ASCII string?

2019-06-20 Thread Victor Stinner
Le jeu. 20 juin 2019 à 11:15, Inada Naoki a écrit : > Can we change _PyUnicode_FromId to use _PyUnicode_FromASCII? How would a developer detect a mistake (non-ASCII) character? Does _PyUnicode_FromASCII() raise an exception, even in release mode? The function is only called once (that's the whol

[Python-Dev] Re: obmalloc (was Have a big machine and spare time? Here's a possible Python bug.)

2019-06-21 Thread Victor Stinner
Le ven. 21 juin 2019 à 23:19, Thomas Wouters a écrit : > Is this really feasible in a world where the allocators can be selected (and > the default changed) at runtime? The memory allocation must not be changed after the Python pre-initialization. What's done after pre-initialization is more to

[Python-Dev] Re: Sponsoring Python development via the PSF

2019-06-25 Thread Victor Stinner
That's great! "The PSF will use Python development fundraising to support CPython development and maintenance." Does someone have more info about that? Who will get the money, how, etc.? Victor Le lundi 24 juin 2019, Brett Cannon a écrit : > We now have https://www.python.org/psf/donations/pyt

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-06-27 Thread Victor Stinner
Hi, I designed tracemalloc with Charles-François Natali in PEP 454. The API is a lightweight abstraction on top of the internal C structures used by the C _tracemalloc module which is designed to minimize the memory footprint. I'm not aware of the pstats format. Adding a new tracemalloc.dump_psta

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-06-27 Thread Victor Stinner
Le ven. 28 juin 2019 à 01:03, Yonatan Zunger a écrit : > Although while I have you hear, I do have a further question about how > tracemalloc works: If I'm reading the code correctly, traces get removed by > tracemalloc when objects are free, which means that at equilibrium (e.g. at > the end o

[Python-Dev] Re: Annoying user on GitHub

2019-07-02 Thread Victor Stinner
Hi, Sometimes, I get an email notification about strange comments (unrelated or make no sense) on commits made 6 months ago if not longer. Usually, I go to the user profile page and I click on "Block or report user": "Report abuse". I'm not sure what happens in this case. I never checks if th

[Python-Dev] Re: 3.7.3 Compile error on CentOS 7 (but 3.6.8 Compiles OK)

2019-07-02 Thread Victor Stinner
Hi, Le 02/07/2019 à 06:22, cso...@uol.com.br a écrit : I am trying to compile Python 3 on Centos7 and I am getting "ModuleNotFoundError: No module named '_ctypes'" I'm not sure that you are asking on the right mailing list. Anyway. Red Hat provides precompiled Python 3.6 for Centos 7: https

[Python-Dev] Re: PyAPI_FUNC() is needed to private APIs?

2019-07-02 Thread Victor Stinner
Le 02/07/2019 à 06:35, Inada Naoki a écrit : I wanted to discuss about only when PyAPI_FUNC() is needed, not about which function should be public. On Unix, PyAPI_FUNC() or extern is basically the same currently: #define PyAPI_FUNC(RTYPE) RTYPE #define PyAPI_DATA(RTYPE) extern RTYPE On

[Python-Dev] Re: 3.7.3 Compile error on CentOS 7 (but 3.6.8 Compiles OK)

2019-07-02 Thread Victor Stinner
used (directly by pip, or by pip dependencies), so instead we try to ensure that ctypes is built on buildbots. Victor Le 02/07/2019 à 11:12, Charalampos Stratakis a écrit : - Original Message - From: "Victor Stinner" To: python-dev@python.org Sent: Tuesday, July 2, 2019 1

[Python-Dev] Re: Annoying user on GitHub

2019-07-02 Thread Victor Stinner
;Report abuse" feature on GitHub for such situations. Most of the time I see the user suspended, and the associated comments deleted. Our GitHub admins can delete comments too. On Tue, Jul 2, 2019, 1:42 AM Victor Stinner <mailto:vstin...@redhat.com>> wrote:     Hi,     Somet

[Python-Dev] Re: obmalloc (was Have a big machine and spare time? Here's a possible Python bug.)

2019-07-04 Thread Victor Stinner
I guess that INADA-san used pyperformance --track-memory. pyperf --track-memory doc: "--track-memory: get the memory peak usage. it is less accurate than tracemalloc, but has a lower overhead. On Linux, compute the sum of Private_Clean and Private_Dirty memory mappings of /proc/self/smaps. On Wind

[Python-Dev] Re: Removing dead bytecode vs reporting syntax errors

2019-07-05 Thread Victor Stinner
Hi, Until a solution which makes everyone happy can be found, I suggest to move back to the status quo: revert the change. More people seems to expect "if 0: ..." to be removed, than people who care of syntax errors on "if 0". -- Would it be possible to detect if the "if 0" block would raise a

[Python-Dev] bpo-37468: make install no longer install wininst-*.exe files

2019-07-15 Thread Victor Stinner
Hi, I modified Makefile.pre.in to avoid installing wininst-*.exe files, since these files are only useful on Windows: the distutils bdist_wininst command only works on Windows. https://bugs.python.org/issue37468 I made the assumption that "make install" is only used on Unix, not on Windows. I nev

[Python-Dev] Re: 🍝 New keyword in bpo: `newcomer friendly`

2019-07-29 Thread Victor Stinner
IMHO such label should be removed at some point from an issue when there is too much disagreement about the issue and/or the proposed solutions. You can find 5 years old "easy" issue with 30+ messages. Such issue even scares me who is used to old bugs. Such issue is no longer "newcomer friendly".

[Python-Dev] Re: Is "%zd" format is portable now?

2019-08-01 Thread Victor Stinner
Hi INADA-san, Is it supported on macOS, FreeBSD, AIX, Android, etc.? My notes on platforms supported by Python: https://pythondev.readthedocs.io/platforms.html For example, xlc C compiler seems to be commonly used on AIX. I don't know how is its C99 support. Can we write an unit test somewhe

[Python-Dev] Re: _PyBytesWriter/_PyUnicodeWriter could be faster

2020-10-26 Thread Victor Stinner
Hi, Le dim. 25 oct. 2020 à 15:36, Ma Lin a écrit : > Some code needs to maintain an output buffer that has an unpredictable size. > Such as bz2/lzma/zlib modules, _PyBytesWriter/_PyUnicodeWriter. > > In current code, when the output buffer grows, resizing will cause > unnecessary memcpy(). > >

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Victor Stinner
Le lun. 19 oct. 2020 à 13:50, Steve Dower a écrit : > Feel free to file a bug, but we'll likely only add a vague note to the > docs about how Windows works here rather than changing anything. I agree that this surprising behavior can be documented. Attempting to provide accurate access time in os

[Python-Dev] Re: When to remove BytesWarning?

2020-10-26 Thread Victor Stinner
Hi, Which operations are impacted by -b and -bb? str == bytes, bytes == str, dict lookup using str or bytes keys? 'unicode' < b'bytes' always raises a TypeError. Le sam. 24 oct. 2020 à 05:20, Inada Naoki a écrit : > To avoid BytesWarning, the compiler needs to do some hack when they > need to st

[Python-Dev] Re: When to remove BytesWarning?

2020-10-26 Thread Victor Stinner
Le sam. 24 oct. 2020 à 15:13, Christian Heimes a écrit : > In my experience it would be useful to keep the bytes warning for > implicit representation of bytes in string formatting. It's still a > common source of issues in code. IMO it's not a big deal to investigate such bugs without the -b / -

[Python-Dev] Re: fail keyword like there is pass keyword

2020-10-26 Thread Victor Stinner
If you use the unittest module, I suggest you to use self.fail() instead: it is standard. Moreover, you can specify a message. https://docs.python.org/dev/library/unittest.html#unittest.TestCase.fail Victor Le ven. 23 oct. 2020 à 21:36, Umair Ashraf a écrit : > Hello > > Can I suggest a feature

[Python-Dev] Re: Macro for logging

2020-10-26 Thread Victor Stinner
Hi, There is the __debug__ builtin variable which is equal to True by default, but is equal to False when Python is run with the -O command line option. The compiler removes dead code when -O is used. Example: $ cat x.py def func(): if __debug__: print("debug") import dis dis.dis(func) # "

[Python-Dev] Re: PEP 11: Drop support for AIX releases without dlopen

2020-10-27 Thread Victor Stinner
Le ven. 16 oct. 2020 à 22:35, Kevin Adler a écrit : > Python has supported using dynload_shlib (using dlopen) on AIX since > https://github.com/python/cpython/commit/c19c5a62aef7dce0e8147655b0d2f087965fae75 > in 2003. This is also about the time that AIX 4.3 went out of support, which > is beli

[Python-Dev] Re: Improve CPython tracing performance

2020-10-29 Thread Victor Stinner
Le jeu. 29 oct. 2020 à 13:02, Fabio Zadrozny a écrit : > Debuggers can call `PyFrame_LocalsToFast` when needed -- otherwise mutating > non-current frames doesn't work anyways. As a note, pydevd already has such a > call: > https://github.com/fabioz/PyDev.Debugger/blob/0d4d210f01a1c0a8647178b2e

[Python-Dev] Drop Solaris, OpenSolaris, Illumos and OpenIndiana support in Python

2020-10-29 Thread Victor Stinner
Hi, I propose to drop the Solaris support in Python to reduce the Python maintenance burden: https://bugs.python.org/issue42173 I wrote a draft PR to show how much code could be removed (around 700 lines in 65 files): https://github.com/python/cpython/pull/23002/files In 2016, I asked if

[Python-Dev] Re: Drop Solaris, OpenSolaris, Illumos and OpenIndiana support in Python

2020-10-30 Thread Victor Stinner
Hi Ronald, Le ven. 30 oct. 2020 à 12:59, Ronald Oussoren a écrit : > I agree. That’s what I tried to write, its not just providing a buildbot but > also making sure that it keeps working and stays green. This is really great! Jesús Cea Avión is also a volunteer to maintain the Solaris (see the

[Python-Dev] Re: Drop Solaris, OpenSolaris, Illumos and OpenIndiana support in Python

2020-10-30 Thread Victor Stinner
Le ven. 30 oct. 2020 à 14:28, Ronald Oussoren a écrit : > Whoa, not so fast. I’m not volunteering work on Solaris support ;-). Oh sorry, I misunderstood your message :-( > That said, I’m willing to review Solaris PRs (time permitting) but cannot > test if changes actually work. "Cannot test"

[Python-Dev] Re: Improve CPython tracing performance

2020-10-30 Thread Victor Stinner
Le ven. 30 oct. 2020 à 11:02, Nick Coghlan a écrit : > > Ok, I've created https://bugs.python.org/issue42197 to track it. > > Please also have a look at PEP 558 and its draft reference > implementation at https://github.com/python/cpython/pull/3640 I don't think that the PEP 558 and bpo-42197 are

[Python-Dev] Re: [RELEASE] Python 3.10.0a2 available for testing

2020-11-04 Thread Victor Stinner
Hi, Currently, building a wheel packaging on Python 3.10 fails with: AssertionError: would build wheel with unsupported tag ('cp310', 'cp310', 'linux_x86_64') This bug is discussed in many places: * PEP 641 -- Using an underscore in the version portion of Python 3.10 compatibility tags ht

[Python-Dev] Re: Drop Solaris, OpenSolaris, Illumos and OpenIndiana support in Python

2020-11-06 Thread Victor Stinner
Le jeu. 29 oct. 2020 à 22:43, Victor Stinner a écrit : > I propose to drop the Solaris support in Python to reduce the Python > maintenance burden: > >https://bugs.python.org/issue42173 > (...) Since I created the issue and the PR, and sent this email to python-dev (one

[Python-Dev] Configure Python initialization (PyConfig) in Python

2020-11-10 Thread Victor Stinner
Hi, If you embed Python in Python, I would like your opinion on https://bugs.python.org/issue42260 issue which adds a way to configure the Python initialization in Python. I'm looking for feedback from people who embed Python and have issues to configure Python as they wish. Simple example (just

[Python-Dev] Re: Configure Python initialization (PyConfig) in Python

2020-11-15 Thread Victor Stinner
Le sam. 14 nov. 2020 à 14:43, Nick Coghlan a écrit : > > My remaining problem is that my PR changes PyConfig_Read(): it no > > longer computes the Python Path Configuration, since it is now > > implemented in Python. IMO it's an acceptable drawback compared to the > > benefit of these new features

[Python-Dev] Re: [python-committers] Steering Council Election Timeline for 2021 term

2020-11-15 Thread Victor Stinner
Reminder: the deadline for nomination is tonight, hurry up ;-) Current candidates can be found at: https://discuss.python.org/c/core-dev/steering-council-nominations/21 Victor Le mer. 28 oct. 2020 à 20:55, Ewa Jodlowska a écrit : > > Hi! > > The timeline for this year's election will be the sam

[Python-Dev] Re: Remove formatter module

2020-11-24 Thread Victor Stinner
Since importing the module emits a DeprecationWarning at runtime since Python 3.4 and the deprecation is properly documented, IMO it's fine to remove it right now: https://docs.python.org/dev/library/formatter.html I never used this module, I don't know what it is. "Formatter objects transform an

[Python-Dev] Re: Ideas for improving the contribution experience

2020-11-24 Thread Victor Stinner
Hi Tal, Thanks for driving such research, it's really interesting. Sadly, I'm not surprised by the results, since I'm already aware of these issues. IMHO the most promising way to get more review is to create groups where developers work on the same topic and review each other. Also, mentoring i

<    7   8   9   10   11   12   13   14   15   16   >