[issue23304] Unused Superclass in calendar.py

2015-01-22 Thread CliffM
New submission from CliffM: calendar.py ( lines 17,18 ) is not used : # Exception raised for bad input (with string parameter for details) error = ValueError This could either be deleted OR used as the superclass in the next two class declarations as the comment suggests

[issue19249] Enumeration.__eq__

2013-10-19 Thread CliffM
CliffM added the comment: It is appropriate to modify the pickle-module to trap (a potential) the singletonicity-breaking event and raise a warning ? (I'm guessing an exception would be far too rude) I like the idea of using identity-equality, but without the above trap one might get really

[issue19281] add __objclass__ to the docs

2013-10-18 Thread CliffM
Changes by CliffM cliffm1...@gmail.com: -- nosy: +CliffM ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19281 ___ ___ Python-bugs-list mailing list

[issue19252] Enum.py : Enum.__new__() : Test Coverage

2013-10-14 Thread CliffM
CliffM added the comment: Sorry -- I could have been clearer : The conditional: if member.value == value: Is redundant as the tests stand. If you comment it out -- everything works. So therefore we are missing a test. The current test works, as red is the first value to pop out

[issue19252] Enum.py : Enum.__new__() : Test Coverage

2013-10-14 Thread CliffM
CliffM added the comment: Yes it's purely a coverage issue. I must try to be more explicit (rather than implicit). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19252

[issue19263] enum.py : Enum.__new__(). __objclass__

2013-10-14 Thread CliffM
New submission from CliffM: Is the assignment __objclass__ = enum_class in enum.py(149) needed ? I cannot find any other reference to it (even Google) and it seems that __class__ is already set to enum_class : enum_member.__objclass__ = enum_class not sure what this is doing I have

[issue19237] Proposal : LCM function to complement GCD

2013-10-13 Thread CliffM
CliffM added the comment: I've handled a patch, and extended both lcm and gcd to take an arbitrary number of arguments -- via functools.reduce, as they are both multiplicative (in the first argument). Also handled the zero case , so lcm(0,0) = 0 = gcd(0,0) Use-case-wise, I do a reasonable

[issue19249] Enumeration.__eq__

2013-10-13 Thread CliffM
New submission from CliffM: Given that enumeration members are Singletons, can we not rely on the default __eq__() method ? (FWIW the existing tests all pass if you delete it) This might be confusing for a reader later, so needs documenting. Although I think it should be documented

[issue19252] Enum.py : Enum.__new__() : Test Coverage

2013-10-13 Thread CliffM
New submission from CliffM: test_nonhash_value tests the lookup of an Enum Member from a value. The current test does not exercise the iteration over values completely -- the if-clause being redundant wrt the existing test. My patch adds an additional test which requires the if-clause

[issue19237] Proposal : LCM function to complement GCD

2013-10-12 Thread CliffM
New submission from CliffM: While implementing a Least-Common-Multiple function (LCM), I noticed that although python has a Greatest-Common-Divisor (GCD) function in the fractions module, the LCM, its counterpart is not there. I've attached a patch which implements and tests LCM

[issue19169] random.py : simple tidying

2013-10-05 Thread CliffM
New submission from CliffM: Standardising some name-shortening in the _randbelow() method. -- components: Extension Modules files: shorten.patch keywords: patch messages: 198984 nosy: CliffM priority: normal severity: normal status: open title: random.py : simple tidying type

[issue19121] Documentation guidelines enhancements

2013-10-05 Thread CliffM
CliffM added the comment: Improving documentation is a fine aim. However, finding the correct balance between reference, tuition and precis (i.e. overview) is tricky. I would like to see more documentation laid out with the code and tests. This at least binds the examples with running code

[issue19156] Enum helper functions test-coverage

2013-10-03 Thread CliffM
New submission from CliffM: Added some tests for the _is_sunder and _is_dunder helper functions in the enum module. -- components: Tests files: enum.patch keywords: patch messages: 198923 nosy: CliffM priority: normal severity: normal status: open title: Enum helper functions test