[Python-Dev] Python equivalents in stdlib Was: Include datetime.py in stdlib or not?

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Jul 7 22:53:23 CEST 2010


On Wed, Jul 7, 2010 at 4:33 PM, Brett Cannon <brett at python.org> wrote:

>>>> 2. There are test classes defined at the test_datetime module level
>>>> that subclass from datetime classes.  The self.module is not available
>>>> at the module level.  These should probably be moved to setUp()
>>>> methods and attached to test case self.
..
>> What about #2?

> Either define two different subclasses or write a function that
> returns the class using the superclass that you want.
>

Selecting one of two globally defined different subclasses will be
ugly in parameterized tests.  An in the other approach, the class
definitions will have to be moved away from the module level and
inside a scope where module variable is present.  Yes, it looks like
some refactoring is unavoidable.


More information about the Python-Dev mailing list