@@ -30,38 +30,21 @@ class IntegerDtype(ExtensionDtype):
30
30
31
31
@classmethod
32
32
def construct_from_string (cls , string ):
33
- if string == cls .name :
34
- return cls ()
35
- else :
36
- raise TypeError ("Cannot construct a '{}' from "
37
- "'{}'" .format (cls , string ))
38
-
39
- @classmethod
40
- def construct_from_string_strict (cls , string ):
41
33
"""
42
- Strict construction from a string, raise a TypeError if not
34
+ Construction from a string, raise a TypeError if not
43
35
possible
44
36
"""
45
- if string [0 ] == 'I' :
46
- return cls .construct_from_string (string )
47
- raise TypeError ("could not construct PeriodDtype" )
37
+ if string == cls .name :
38
+ return cls ()
39
+ raise TypeError ("Cannot construct a '{}' from "
40
+ "'{}'" .format (cls , string ))
48
41
49
42
50
43
class UnsignedIntegerDtype (IntegerDtype ):
51
44
kind = 'u'
52
45
is_signed_integer = False
53
46
is_unsigned_integer = True
54
47
55
- @classmethod
56
- def construct_from_string_strict (cls , string ):
57
- """
58
- Strict construction from a string, raise a TypeError if not
59
- possible
60
- """
61
- if string [0 ] == 'U' :
62
- return cls .construct_from_string (string )
63
- raise TypeError ("could not construct PeriodDtype" )
64
-
65
48
66
49
def to_integer_array (values ):
67
50
"""
@@ -457,7 +440,7 @@ class UnsignedIntegerArray(IntegerArray):
457
440
setattr (module , classname , dtype_type )
458
441
459
442
# register
460
- registry .register (dtype_type , dtype_type . construct_from_string_strict )
443
+ registry .register (dtype_type )
461
444
462
445
463
446
# create the Array
0 commit comments