Skip to content

Exception in episode 1 #10

@markgdawson

Description

@markgdawson

Mixing the concepts of exception and inheritance could be confusing here. Could introduce inheritance first, then introduce the use case of exception as a use of that.

Something like:

class MyArray(numpy.ndarray):
  pass

followed by

a = MyArray(shape=(10,10))
type(a) # shows MyArray
isinstance(a, MyArray)
isinstance(a, np.ndarray)

Would be very nice if we could find an example like this which could be extended (i.e. by adding a body to the class) in later episodes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions