[Python-ideas] Add a developer mode to Python: -X dev command line option
M.-A. Lemburg
mal at egenix.com
Wed Mar 30 06:26:36 EDT 2016
On 30.03.2016 09:49, Victor Stinner wrote:
> I propose to add a "development mode" to Python, to get a few checks
> to detect bugs earlier: a new -X dev command line option. Example:
>
> python3.6 -X dev script.py
>
> ...
>
> The scope of the "developer mode" is unclear to me. Many modules (ex:
> asyncio) already have a debug mode. Would it be a bad idea to enable
> *all* debug modes of *all* modules? For example, http.client has a
> debug level: do you expect debug traces of the HTTP client when you
> develop your application?
>
> IMHO the scope must be well defined: don't modify modules of the
> stdlib, only enable more debug flags in the Python core (warnings,
> unicode, memory allocators, etc.).
I'm not sure whether this would make things easier for the
majority of developers, e.g. someone not writing C extensions
would likely not be interested in debugging memory allocations
or segfaults, someone spending more time on numerics wouldn't
bother with bytes warnings, etc.
I usually use wrappers or custom Python builds for debugging
purposes, which are then specialized for the specific task
I need them for. Those are quick to write and more explicit in
what they enable or not. I wouldn't want to rely on a specific
set of flags which may change from Python release to Python release.
So overall, I guess adding a debug howto of some sort showing
and explaining the purpose of the various options would be more
helpful to developers than a meta-option which triggers some subset
of other available options.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Experts
>>> Python Projects, Coaching and Consulting ... http://www.egenix.com/
>>> Python Database Interfaces ... http://products.egenix.com/
>>> Plone/Zope Database Interfaces ... http://zope.egenix.com/
________________________________________________________________________
::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the Python-ideas
mailing list