Class UnicodeError
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
NumPy-compatible UnicodeError — Python's base class for text encoding and decoding failures, a
subclass of ValueError. NumSharp raises its two concrete subclasses,
UnicodeEncodeError and UnicodeDecodeError, when a value crosses between a
fixed-width Unicode (U) and a byte-string (S) dtype the way NumPy's ASCII codec refuses it.
public class UnicodeError : ValueError, ISerializable, INumSharpException
- Inheritance
-
UnicodeError
- Implements
- Derived
- Inherited Members
Remarks
Catching ValueError (or ArgumentException) catches these too, exactly as
except ValueError catches Python's Unicode errors. The message is CPython's verbatim
UnicodeError.str text, so error parity with NumPy is a string comparison.
Constructors
UnicodeError(string)
Creates the error with CPython's message text.
public UnicodeError(string message)
Parameters
messagestringThe verbatim message (
'ascii' codec can't encode …).
UnicodeError(string, Exception)
Creates the error with CPython's message text and the failure that caused it.
public UnicodeError(string message, Exception innerException)