File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Version 0.2.1
5
5
=============
6
6
7
7
- Fix issue with named groups.
8
+ - Nicer `TypeError `\s , if pattern types are unequal.
8
9
9
10
Version 0.2.0
10
11
=============
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ def __add__(self, other):
57
57
if isinstance (other , r ):
58
58
if self .pattern .__class__ != other .pattern .__class__ :
59
59
raise TypeError (
60
- 'incompatible pattern types: {} and {}' .format (
61
- self .pattern . __class__ , other .pattern . __class__
60
+ 'incompatible pattern types: {!r } and {!r }' .format (
61
+ self .pattern , other .pattern
62
62
)
63
63
)
64
64
elif isinstance (self .pattern , bytes ):
@@ -76,9 +76,9 @@ def __or__(self, other):
76
76
if isinstance (other , r ):
77
77
if self .pattern .__class__ != other .pattern .__class__ :
78
78
raise TypeError (
79
- 'incompatible pattern types: {} and {}' .format (
80
- self .pattern . __class__ ,
81
- other .pattern . __class__
79
+ 'incompatible pattern types: {!r } and {!r }' .format (
80
+ self .pattern ,
81
+ other .pattern
82
82
)
83
83
)
84
84
elif isinstance (self .pattern , bytes ):
You can’t perform that action at this time.
0 commit comments