This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: decimal module contains less symbols when the _decimal module is missing
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: mark.dickinson, python-dev, skrah, vstinner
Priority: normal Keywords:

Created on 2014-08-27 09:59 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg225954 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-08-27 09:59
While investigation issue #22283, I noticed that when the _decimal is present, the decimal looses its __all__ attribute. dir(decimal) contains 5 more symbols than decimal.__all__:
{'ConversionSyntax',
 'DecimalTuple',
 'DivisionImpossible',
 'DivisionUndefined',
 'InvalidContext'}

These symbols should be added to decimal.__all__, or _decimal should also have a __all__ attribute.
msg225956 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2014-08-27 10:16
I agree.  I plan to fix this as part of #19232. If decimal.py and
_decimal are split properly, these things show up immediately.
msg226649 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-09 17:59
New changeset 2b3dbbd2bd92 by Stefan Krah in branch '3.4':
Issue #22284: Update decimal.__all__
http://hg.python.org/cpython/rev/2b3dbbd2bd92

New changeset 5bc23c111de1 by Stefan Krah in branch 'default':
Issue #22284: Merge 3.4
http://hg.python.org/cpython/rev/5bc23c111de1
msg226651 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2014-09-09 18:01
I didn't add __all__ to _decimal because of this thread here:

https://mail.python.org/pipermail/python-dev/2001-February/012591.html
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66480
2014-09-09 18:01:35skrahsetstatus: open -> closed

dependencies: - Speed up _decimal import
type: behavior
components: + Library (Lib)
versions: + Python 3.4
messages: + msg226651
resolution: fixed
stage: resolved
2014-09-09 17:59:09python-devsetnosy: + python-dev
messages: + msg226649
2014-08-27 10:17:04skrahsetdependencies: + Speed up _decimal import
2014-08-27 10:16:21skrahsetnosy: + mark.dickinson
messages: + msg225956
2014-08-27 09:59:40vstinnercreate