1. Łukasz Langa
  2. nattyprint

Commits

Łukasz Langa  committed 30c4da4

__accepts__ for set and frozenset formatters

  • Participants
  • Parent commits 9e33d17
  • Branches default

Comments (0)

Files changed (1)

File nattyprint.py

View file
  • Ignore whitespace
     EMPTY_CONTAINER = 'set()'
 
     @classmethod
+    def __accepts__(cls, other):
+        return other.__class__ is set
+
+    @classmethod
     def _pprint_generate_elements(cls, instance):
         try:
             for elem in sorted(instance):
     SUFFIX = '))'
     EMPTY_CONTAINER = 'frozenset()'
 
+    @classmethod
+    def __accepts__(cls, other):
+        return other.__class__ is frozenset
 
 formatters = []