summaryrefslogtreecommitdiffstats
path: root/Doc/library/enum.rst
Commit message (Collapse)AuthorAgeFilesLines
* Fix grammar in enum documentation. (GH-24689)Miss Islington (bot)2021-04-011-1/+1
| | | | | | | | | There is an extra `s` in the singular word `method`. Reported in docs mailing list by Steven Nguyen. Automerge-Triggered-By: GH:Mariatta (cherry picked from commit f193874056fb185305084b79b32d2745ce9be7cf) Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
* [3.8] [doc] Fix a few margins due to bad markup (GH-23619). (GH-23860)Andre Delfino2020-12-221-1/+1
| | | | | (cherry picked from commit 96a09df64483b70c4215c7025a19b9d2f1636c55) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22369)Miss Islington (bot)2020-09-231-0/+26
| | | | | (cherry picked from commit 62e40d8450b9c78346ec3617de7fe3f0ad381510) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-40721: add note about enum member name case (GH-22231)Miss Islington (bot)2020-09-141-0/+6
| | | | | | * UPPER_CASE preferred as enum members are constants (cherry picked from commit 542e1df2b018ee7068dba8076f2d6e84efd6e144) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.8] bpo-37479: Enum - use correct __format__ (GH-14545)Ethan Furman2020-09-131-3/+5
| | | | | | * bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__. (cherry picked from commit 2f19e82fbe98ce86bcd98a176328af2808b678e8) Co-authored-by: thatneat <thatneat@users.noreply.github.com>
* bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901) (GH-21928)Victor Stinner2020-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the c_warn_on_allowed_pre_v3 option to make the documentation compatible with Sphinx 2 and Sphinx 3. (cherry picked from commit 423e77d6de497931585d1883805a9e3fa4096b0b) * bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858) Use generic '.. object::' to declare markers, rather than abusing '.. c:function::' which fails on Sphinx 3. (cherry picked from commit 43577c01a2ab49122db696e9eaec6cb31d11cc81) * bpo-40204: Fix duplicates in the documentation (GH-21857) Fix two Sphinx 3 issues: Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'. Declaration is 'PyBUF_ND'. Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'. Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'. (cherry picked from commit 46d10b1237c67ff8347f533eda6a5468d098f7eb) * bpo-40204: Add :noindex: in the documentation (GH-21859) Add :noindex: to duplicated documentation to fix "duplicate object description" errors. For example, fix this Sphinx 3 issue: Doc/library/configparser.rst:1146: WARNING: duplicate object description of configparser.ConfigParser.optionxform, other instance in library/configparser, use :noindex: for one of them (cherry picked from commit d3ded080482beae578faa704b13534a62d066f9f) * bpo-40204, doc: Fix syntax of C variables (GH-21846) For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3. (cherry picked from commit 474652fe9346382dbf793f20b671eb74668bebde) * bpo-40204: Fix reference to terms in the doc (GH-21865) Sphinx 3 requires to refer to terms with the exact case. For example, fix the Sphinx 3 warning: Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case sensitive match.made a reference to loader instead. (cherry picked from commit bb0b08540cc93e56f3f1bde1b39ce086d9e35fe1) * bpo-40204: Fix duplicated productionlist names in the doc (GH-21900) Sphinx 3 disallows having more than one productionlist markup with the same name. Simply remove names in this case, since names are not shown anyway. For example, fix the Sphinx 3 warning: Doc/reference/introduction.rst:96: duplicate token description of *:name, other instance in reference/expressions (cherry picked from commit 1abeda80f760134b4233608e2c288790f955b95a) (cherry picked from commit 8f88190af529543c84d5dc78f19abbfd73335cf4)
* bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763)Miss Islington (bot)2020-05-271-0/+4
| | | require `_generate_next_value_` to be defined before members
* bpo-39234: Doc: `enum.auto()` incrementation value not specified. (GH-17872) ↵Miss Islington (bot)2020-01-251-1/+1
| | | | | | | | (GH-17875) (cherry picked from commit 2e9012a3e1e316c54e27f51ba5849ba06eab7da2) Co-authored-by: YoSTEALTH <35307184+YoSTEALTH@users.noreply.github.com>
* Fix typo: class declaration (GH-11678)nu_no2019-01-271-1/+1
|
* bpo-29577: Enum: mixin classes don't mix well with already mixed Enums (GH-9328)Ethan Furman2018-09-221-3/+10
| | | * bpo-29577: allow multiple mixin classes
* bpo-33437: add __new__ vs __init__ example (GH-9145)Ethan Furman2018-09-121-0/+31
| | | | | | Improve Enum docs. https://bugs.python.org/issue33437
* bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651)Rahul Jha2018-09-101-1/+1
| | | * bpo-33217: Raise TypeError for non-Enum lookups in Enums
* Fix moduleauthor/sectionauthor directives in Enum (GH-8117)Andrés Delfino2018-07-071-4/+4
|
* bpo-33866: enum: Stop using OrderedDict (GH-7698)INADA Naoki2018-06-181-2/+2
|
* bpo-31801: Enum: add _ignore_ as class option (#5237)Ethan Furman2018-01-221-1/+25
| | | | | | | | | | | | | | | | * bpo-31801: Enum: add _ignore_ as class option _ignore_ is a list, or white-space seperated str, of names that will not be candidates for members; these names, and _ignore_ itself, are removed from the final class. * bpo-31801: Enum: add documentation for _ignore_ * bpo-31801: Enum: remove trailing whitespace * bpo-31801: Enum: fix bulleted list format * bpo-31801: add version added for _ignore_
* Improve enum.Flag code example (GH-5167)Julian Kahnert2018-01-131-1/+1
| | | | The code example that demonstrate how to use enum.Flag was missing the import of enum.auto.
* correct documentation for enum.html (#358)Kartik Anand2017-02-281-2/+2
|
* Issue #29129: Fix typo in "Using auto" sectionBerker Peksag2017-01-021-1/+1
|
* close issue28172: Change all example enum member names to uppercase, per ↵Ethan Furman2016-11-211-172/+173
| | | | Guido; patch by Chris Angelico.
* issue23591: fix flag decomposition and reprEthan Furman2016-09-181-0/+22
|
* issue23591: add auto() for auto-generating Enum member valuesEthan Furman2016-09-111-16/+83
|
* improve Enum docsEthan Furman2016-09-081-11/+12
|
* add recipes for pseudo-valueless enumsEthan Furman2016-09-071-11/+68
|
* issue23591: more docs; slight change to reprEthan Furman2016-09-041-1/+12
|
* issue23591: bool(empty_flags) == False; more docs & testsEthan Furman2016-09-021-3/+59
|
* issue23591: add docs; code cleanup; more testsEthan Furman2016-09-021-46/+127
|
* issue26981: add _order_ compatibility shim to enum.EnumEthan Furman2016-08-201-1/+20
|
* Issue26988: remove AutoEnumEthan Furman2016-08-201-218/+65
|
* Silence warnings from 'make suspicious' to make the docs buildbot happyBerker Peksag2016-08-061-7/+9
|
* Add AutoEnum: automatically provides next value if missing. Issue 26988.Ethan Furman2016-08-051-65/+216
|
* Issue #24314: Merge doc links from 3.5Martin Panter2016-06-181-1/+1
|\
| * Issue #24314: Fix doc links for general attributes like __name__, __dict__Martin Panter2016-06-181-1/+1
| |
* | Issue #27125: Merge typo fixes from 3.5Martin Panter2016-05-301-2/+2
|\ \ | |/
| * Issue #27125: Remove duplicated words from documentation and commentsMartin Panter2016-05-301-2/+2
| |
* | Issue #25179: Documentation for formatted string literals aka f-stringsMartin Panter2016-02-131-1/+2
| | | | | | | | | | Some of the inspiration and wording is taken from the text of PEP 498 by Eric V. Smith, and the existing str.format() documentation.
* | Merge string formatting doc fixes from 3.5Martin Panter2016-02-081-6/+6
|\ \ | |/
| * Issue #25179: Preparatory cleanup of existing docs on string formattingMartin Panter2016-02-081-6/+6
| | | | | | | | | | | | | | | | | | * Various sections were pointing to the section on the string.Formatter class, when the section on the common format string syntax is probably more appropriate * Fix references to various format() functions and methods * Nested replacement fields may contain conversions and format specifiers, and this is tested; see Issue #19729 for instance
| * Close issue25594: advise against accessing Enum members from other membersEthan Furman2015-11-201-10/+16
| |
* | use public 'value'Ethan Furman2016-01-161-1/+1
| |
* | revert change 87a9dff5106c: pure Enum members again evaluate to True;Ethan Furman2016-01-151-1/+10
| | | | | | | | | | update Finer Points section of docs to cover boolean evaluation; add more tests for pure and mixed boolean evaluation
* | Close 25594: advise against accessing Enum members from other membersEthan Furman2015-11-201-10/+16
| |
* | Issue #25210: Change error message of do_richcompare()Victor Stinner2015-10-141-1/+1
|/ | | | | | | | | | | | Don't add parenthesis to type names. Add also quotes around the type names. Before: TypeError: unorderable types: int() < NoneType() After: TypeError: '<' not supported between instances of 'int' and 'NoneType'
* Issue #25161: Merge full stops from 3.4 into 3.5Martin Panter2015-10-101-1/+1
|\
| * Issue #25161: Add full stops in documentation; patch by Takase ArihiroMartin Panter2015-10-101-1/+1
| |
* | whatsnew/3.5: Sync whatsnew with versionadded/versionchanged doc tagsYury Selivanov2015-09-111-1/+1
| |
* | Issue22997: minor doc update; thanks to Simoen VisserEthan Furman2015-01-151-3/+7
|\ \ | |/
| * Issue22997: minor doc update; thanks to Simoen VisserEthan Furman2015-01-151-3/+7
| |
* | standardize Enum docs by referring to 'special methods' instead of ↵Ethan Furman2014-11-011-5/+5
| | | | | | | | __dunder__ methods
* | Doc: fix default role usage (except in unittest mock docs)Georg Brandl2014-10-301-1/+1
| |
* | Issue #21706: Add a versionchanged directive to the functional API docs.Berker Peksag2014-09-181-0/+3
| |