示例#1
0
文件: traits.py 项目: Hc10b/py3traits
    def __iter__(self):
        """ Walk through each given trait.

        Any class source is walked through for its contents.
        """
        for trait in flatten(map(TraitSource, self.__traits)):
            yield trait
示例#2
0
    def __iter__(self):
        """ Walk through each given trait.

        Any class source is walked through for its contents.
        """
        for trait in flatten(map(TraitSource, self.__traits)):
            yield trait
 def test_can_be_flattened(self):
     flat = flatten(self.classtype)
     self.assertEqual(sorted([str(f) for f in list(flat)]),
                      ['classmethod', 'method', 'property', 'staticmethod'])
示例#4
0
 def test_can_be_flattened(self):
     flat = flatten(self.classtype)
     self.assertEqual(sorted([str(f) for f in list(flat)]),
                      ['classmethod', 'method', 'property', 'staticmethod'])