mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Python] NotImplemented → NotImplementedError
From the Python documentation: * NotImplemented: "Special value which can be returned by the 'rich comparison' special methods (__eq__(), __lt__(), and friends), to indicate that the comparison is not implemented with respect to the other type." * NotImplementedError: "This exception is derived from RuntimeError. In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method."
This commit is contained in:
@@ -15,19 +15,24 @@ class UnicodeProperty(object):
|
||||
"""Abstract base class for Unicode properties."""
|
||||
|
||||
def __init__(self):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError(
|
||||
"UnicodeProperty.__init__ is not implemented.")
|
||||
|
||||
def get_default_value(self):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError(
|
||||
"UnicodeProperty.get_default_value is not implemented.")
|
||||
|
||||
def get_value(self, cp):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError(
|
||||
"UnicodeProperty.get_value is not implemented.")
|
||||
|
||||
def to_numeric_value(self, value):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError(
|
||||
"UnicodeProperty.to_numeric_value is not implemented.")
|
||||
|
||||
def get_numeric_value(self, cp):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError(
|
||||
"UnicodeProperty.get_numeric_value is not implemented.")
|
||||
|
||||
class GraphemeClusterBreakPropertyTable(UnicodeProperty):
|
||||
"""Grapheme_Cluster_Break property."""
|
||||
|
||||
Reference in New Issue
Block a user