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

Brett Cannon brett at python.org
Wed Jul 7 23:36:25 CEST 2010


On Wed, Jul 7, 2010 at 13:53, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> 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.

Didn't say it was a pretty solution. =)

>  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.

Yep, which is not a big deal.

>  Yes, it looks like
> some refactoring is unavoidable.
>

=)


More information about the Python-Dev mailing list