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
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 r
Changes by CliffM :
--
nosy: +CliffM
___
Python tracker
<http://bugs.python.org/issue19281>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
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 >
CliffM added the comment:
Yes it's purely a coverage issue. I must try to be more explicit (rather than
implicit).
--
___
Python tracker
<http://bugs.python.org/is
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 of the
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
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 (in
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 reaso
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 i
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
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
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
13 matches
Mail list logo