You can probably do sorting, inheritance, and interfaces at the same time?

An ISortable object must have a .sort() method. e.g. DoublyLinkedList(LinkedList).

"15 Sorting Algorithms in 6 Minutes"
- # of comparisons
- # of array accesses

... Big-O Cheat Sheet
- "Array Sorting Algorithms"
- Time Complexity: Best, Average, Worst
- Space Complexity: Worst

I don't have K12 students.

It's important to learn OOP. There really is a push back from OOP-over-abstraction to functional with interfaces by convention with  e.g. Go,. As a multi-paradigm language built on C (not C++ (OOP which predates Java)), programs can be written in many styles with Python.

There is - some might argue negligible - overhead to each function call. Is there a good way to do compile-time interface checking with Python? Why not?

zope.interface is probably the most popular way to do 'actual' interfaces in Python.

Pyramid framework has zope.interface interfaces.
- IResponse
- IRequest (a 'marker' interface)

An OOP exercise:

# Namespacing
def area_of_a_rectangle()
def perimeter_of_a_rectangle()
def shape__rectangle__area()
def shape__square__area()

# Inheritance, Interfaces, Parameters
class Shape()
    def __init__(*args, **kwargs):  # *
    def area()
    def perimeter()
    def height/width/[depth]()
        # physical units
            # class Number(float):
            #     def __init__(value, unit=)
class Square()
class Rectangle()
class Triangle()

Sorting, [multiple] database indexes (import sqlite), and tree-balancing may be appropriate to teach or mention together or in an optimal sequence.

    - OOP

sorted() is implemented with/as a Timsort (and expects an interface (is it __cmp__, __gt__, __lt__, AND __eq__?)).

On Tuesday, August 14, 2018, Jurgis Pralgauskis <> wrote:

The dillema I have when teaching:
 our k12 curricullum of programming is more based on algorithms (math ideas), 
but when working as programmer, I see the bigger need of SW architecture knowledge.. 

 OOP is one big topic, which could replace sorting alg stuff (that I never applied (directly) in this century...). The topics could be integrated in making mini game engine :) 

I'd still leave classics of sum, min search, and search in sorted vs non array to get the idea of algorithms.

What are your approaches, if you have programming classes in K12?
Jurgis Pralgauskis
tel: 8-616 77613