Ordering Members in Different Files

Class members that are defined in different files are sorted by a key of (minus of source file index, line number).

File 10 appendix/member_order_base.py

# other code

# other code

# other code

# other code

# other code


class A:
    def a(self):
        """mro index: 1, sourcefile index: 1, line number: 13."""

File 11 appendix/member_order_sub.py

from appendix.member_order_base import A


class B:
    def b(self):
        """mro index: 2, sourcefile index: 0, line number: 5."""


class C(A, B):
    def c(self):
        """mro index: 0, sourcefile index: 0, line number: 10."""
class
appendix.member_order_base.A()
Methods
  • a() mro index: 1, sourcefile index: 1, line number: 13.
method
a()

mro index: 1, sourcefile index: 1, line number: 13.

class
appendix.member_order_sub.B()
Methods
  • b() mro index: 2, sourcefile index: 0, line number: 5.
method
b()

mro index: 2, sourcefile index: 0, line number: 5.

class
appendix.member_order_sub.C()
Methods
  • a() mro index: 1, sourcefile index: 1, line number: 13.
  • b() mro index: 2, sourcefile index: 0, line number: 5.
  • c() mro index: 0, sourcefile index: 0, line number: 10.
method
a()

mro index: 1, sourcefile index: 1, line number: 13.

method
b()

mro index: 2, sourcefile index: 0, line number: 5.

method
c()

mro index: 0, sourcefile index: 0, line number: 10.