Regarding the effect on dir(), I’d like to note that unittest and pytest use dir() on module and class objects to discover tests. This means that if export is used in a test file, tests that are not exported will be silently ignored.
If this turns out to be undesirable, perhaps pytest could implement its own dir(), however this is not currently possible cleanly (see Expose special method lookup at Python level - #13 by bluetech ).