beeware / ouroboros

A standalone, pure Python implementation of the Python Standard Library.
Other
294 stars 48 forks source link

Mine MicroPython lib for potential treasure #17

Closed gephelps closed 6 years ago

gephelps commented 6 years ago

The idea here was to mine the library for MicroPython to see if there were libraries that are done in cpython typically, but may have been redone in Python itself for this distribution. Observations are broken in two groups: 1) Files that appear in MicroPython and not Ouroboros 2) Files that are common between the two -- The bottom line is for the majority of overlap the Ouroboros libraries are arguably most complete. For anything that exists in MicroPython only there is some overlap (due to 'u' micro versions.)

Files that appear in micropython, but do not appear in Ouroboros currently. binascii/binascii.py #imports from ubinascii bisect/bisect.py #defines: insort_right insort bisect_right bisect insort_left bisect_left collections.defaultdict/collections/defaultdict.py #standalone defines defaultdict collections.dequeu/collections/deque.py #standalone defines deque cpython-uayncio/uasyncio.py #imports from asyncio errno/errno.py #defines a number of statics fnctl/fnctl.py #loads ffilib ffilib.libc() fflib/fflib.py #loads libc hashlib/hashlib/_sha224.py #imports from _sha256 hashlib/hashlib/_sha256.py #standalone hashlib/hashlib/_sha384.py #imports from _sha512 hashlib/hashlib/_sha512.py #standalone machine/machine/init.py #imports from umachine machine/machine/pin.py #imports umachine machine/machine/timer.py #uses ffilib ffilib.open("librt") pkg_resources/pkg_resources.py #imports from uio pwd/pwd.py #uses ffilib ffilib.libc() pyb/pyb.py #defines a single simple class pystone/pystone.py #mostly standalone pystone_lowmem/pystone_lowmem.py #mostly standalone re-pcre/re.py #uses ffilib ffilib.open("libpcre") sdist_upip.py #defines alternate pip select/select.py #uses ffilib ffilib.libc() signal/signal.py #uses ffilib ffilib.libc() not much here sqlite3/sqlite3.py #uses ffilib ffilib.open("libsqlite3") time/time.py #uses ffilib ffilib.libc() uaiohttpclient/uaiohttpclient.py #imports from uasyncio uasyncio/uasyncio/init.py #skipped uasyncio.core/uasyncio/core.py #skipped uasyncio.queues/uasyncio/queues.py #skipped uasyncio.synchro/uasyncio/synchro.py #skipped uasyncio.udp/uasyncio/udp.py #skipped uasyncio.websocket.server/uasyncio/websocket/server.py #skipped ucontextlib/tests.py #skipped ucontextlib/ucontextlib.py #skipped ucurses/ucurses/init.py #skipped udnspkt/udnspkt.py #imports uio defines a few methods umqtt.robust/umqtt/robust.py #defines a few simple functions umqtt.simple/umqtt/simple.py #imports from usocket ustruct and ubinascii unicodedata/unicodedata.py #ignore this. Two one line methods upip/upip.py #makes an alternate pip upip/upip_utarfile.py #mostly standalone upysh/upysh.py #defines a new method that essentially wraps os urllib.urequests/urequests.py #imports from usocket. Defines a simple urlopen utarfile/utarfile.py #mostly standalone defines a Tar class uu/uu.py #standalone xmltok/xmltok.py #standalone

The idea here from now on is the files from the Ouroboros code are on the left. If an exact file name match was found in MicroPython then it is the next file (in a list). The comments about the files follow. A blank line repeats the whole process. The bottom line is in all cases where there is a current implementation of foo in Ouroboros it is probably better to keep the existing implementation.

./future.py ['./future/future.py'] These files are massively different with the Ouroboros file being much more complete. The micropython file defines 7 booleans: nested_scopes = True generators = True division = True absolute_import = True with_statement = True print_function = True unicode_literals = True The Ouroboros defines the same names. There are many other constants defined. There is also a class names _Feature defined.

./init.py ['./collections/collections/init.py', './concurrent.futures/concurrent/futures/init.py', './hashlib/hashlib/init.py', './html/html/init.py', './json/json/init.py', './machine/machine/init.py', './os/os/init.py', './uasyncio/uasyncio/init.py', './ucurses/ucurses/init.py'] No file to match on the micropython side

./_markupbase.py ['./_markupbase/_markupbase.py'] These two files are the same

./abc.py ['./abc/abc.py'] --These files are massively different with the Ouroboros file being much more complete. The micropython file is basically a stub. --The micropython defines a function called abstractmethod which returns the input to abstractmethod. --The Ouroboros functions: abstractmethod get_cache_token --The Ouroboros classes: abstractclassmethod abstractstaticmethod abstractproperty ABCMeta ABC

./argparse.py ['./argparse/argparse.py'] --There are a lot of differences between these two files. A lot less is imported on the micropython side. The docstring on the micro python side: Minimal and functional version of CPython's argparse module --Micropython high level definitions: class _ArgError(BaseException): class _Arg: def _dest_from_optnames(opt_names): class ArgumentParser:

--Ouroboros high level definitions: class _AttributeHolder(object): def _ensure_value(namespace, name, value): class HelpFormatter(object): class RawDescriptionHelpFormatter(HelpFormatter): class RawTextHelpFormatter(RawDescriptionHelpFormatter): class ArgumentDefaultsHelpFormatter(HelpFormatter): class MetavarTypeHelpFormatter(HelpFormatter): def _get_action_name(argument): class ArgumentError(Exception): class ArgumentTypeError(Exception): class Action(_AttributeHolder): class _StoreAction(Action): class _StoreConstAction(Action): class _StoreTrueAction(_StoreConstAction): class _StoreFalseAction(_StoreConstAction): class _AppendAction(Action): class _AppendConstAction(Action): class _CountAction(Action): class _HelpAction(Action): class _VersionAction(Action): class _SubParsersAction(Action): class FileType(object): class Namespace(_AttributeHolder): class _ActionsContainer(object): class _ArgumentGroup(_ActionsContainer): class _MutuallyExclusiveGroup(_ArgumentGroup): class ArgumentParser(_AttributeHolder, _ActionsContainer):

./asyncio ['./asyncio']

./asyncio/init.py ['./uasyncio/uasyncio/init.py'] --These files are different. The Ouroboros file only imports a lot of other modules. The micropython file does much fewer imports and defines the following classes: PollEventLoop StreamReader StreamWriter --The micropython file also defines the following functions: open_connection start_server

./asyncio/queues.py ['./uasyncio.queues/uasyncio/queues.py'] There are differences in the two files, with the Ouroboros file being more robust in certain methods. It looks like they try to employ the same basic abilities.

./base64.py ['./base64/base64.py'] --These files look similar and define the same methods. The micropython impementation is not quite as complete though. For example in the urlsafe_b64encode and urlsafe_b64decode it raises a NotImplementedError() --Ascii85 encoding/decoding is not present on the micropython file.

./binhex.py ['./binhex/binhex.py'] --The file exists in the micropython side, but the file is completely empty. The comment on github said they implemented a dummy file.

./bisect.py ['./bisect/bisect.py'] The two files are the same.

./calendar.py ['./calendar/calendar.py'] The file exists in micropython, but is completely empty.

./cgi.py ['./cgi/cgi.py'] These two files are largely the same. It looks like the micorpython side simply has a bit less error checking.

./cmd.py ['./cmd/cmd.py'] --These two files are largely the same. The micropython side purposely removes some functionality and that is documented: This is a copy of python's Cmd, but leaves out features that aren't relevant or can't currently be implemented for MicroPython.

One of the notable deviations is that since MicroPython strips doc strings, this means that that help by doc string feature doesn't work.

./code.py ['./code/code.py'] This file is an empty stub on the micropython side.

./codecs.py ['./codecs/codecs.py'] This file is an empty stub on the micropython side.

./codeop.py ['./codeop/codeop.py'] This file is an empty stub on the micropython side.

./collections/init.py ['./collections/collections/init.py'] --There are major changes here with the micropython file deliberately being incomplete. From the comments:

Should be reimplemented for MicroPython

Reason:

CPython implementation brings in metaclasses and other bloat.

This is going to be just import-all for other modules in a namespace package

./concurrent ['./concurrent.futures/concurrent']

./concurrent/init.py ['./concurrent.futures/concurrent/futures/init.py'] The micropython file is empty and the Ouroboros one is a single comment.

./concurrent/futures ['./concurrent.futures/concurrent/futures']

./concurrent/futures/init.py ['./concurrent.futures/concurrent/futures/init.py'] The micropython file is empty and the Ouroboros file simply does a few imports.

./contextlib.py ['./contextlib/contextlib.py'] The layout of the two files is largely the same. The Ouroboros file is more complete. Ouroboros also implements redirect_stdout which does not exist in micropython.

./copy.py ['./copy/copy.py'] --The micropython implementation is intentionally less complete. micropython removes support for bytes and frozenset for example.

./csv.py ['./csv/csv.py'] --This file is an empty stub on the micropython side.

./curses/init.py ['./ucurses/ucurses/init.py'] --Micropython has an implementation for curses and ucurses. There is no init.py for curses however in the micropython side. Ouroboros does not include ucurses at all.

./curses/ascii.py ['./curses.ascii/curses/ascii.py'] These files are the same

./datetime.py ['./datetime/datetime.py'] These two files are largely the same. The Ouroboros implementation looks to be a bit more complete. For example _divide_and_round does not exist in micropython.

./dbm ['./dbm'] DBM is a dummy implementation in micropython.

./decimal.py ['./decimal/decimal.py'] This is a blank dummy stub in micropython

./difflib.py ['./difflib/difflib.py'] This is a blank dummy stub in micropython

./email ['./email.charset/email', './email.encoders/email', './email.errors/email', './email.feedparser/email', './email.header/email', './email.internal/email', './email.message/email', './email.parser/email', './email.utils/email'] The whole implementation for email in general seems to be stripped down in micropython.

./email/_encoded_words.py ['./email.internal/email/_encoded_words.py'] The two files are the same except for a single character in a comment.

./email/_parseaddr.py ['./email.internal/email/_parseaddr.py'] The two files are the same

./email/_policybase.py ['./email.internal/email/_policybase.py'] The two files are essentially the same. There are two differences: 1) for _extend_docstrings micropython returns immediately: def _extend_docstrings(cls): return cls

2) For the class Policy it no longer defines a metaclass: class Policy(_PolicyBase):#, metaclass=abc.ABCMeta):

./email/base64mime.py ['./email.encoders/email/base64mime.py'] The two files are the same

./email/charset.py ['./email.charset/email/charset.py'] These two files are nearly identical. There is a comment on the micropython side noting something that should be done later:

Note that this clause doesn't handle the case of a _payload that

        # is already bytes.  It never did, and the semantics of _payload
        # being bytes has never been nailed down, so fixing that is a
        # longer term TODO.

./email/encoders.py ['./email.encoders/email/encoders.py'] These two files are largely the same, but there is more error checking on the micropython side.

./email/errors.py ['./email.errors/email/errors.py'] These two files are the same except the definition of one class. It does not extend the TypeError class: class MultipartConversionError(MessageError):#, TypeError): """Conversion to a multipart is prohibited."""

./email/feedparser.py ['./email.feedparser/email/feedparser.py'] There are minor differences in the files between the two. It looks like there are a couple more checks on the micropython side.

./email/header.py ['./email.header/email/header.py'] These two files are essentially the same. Micropython imports sys twice later in the code for some unknown reason.

./email/iterators.py ['./email.message/email/iterators.py'] These two files are essentially identical.

./email/message.py ['./email.message/email/message.py'] There are differences between the two files here, but they have largely the exact same structure. It appears the Ouroboros side looks to do more error checking.

./email/mime/message.py ['./email.message/email/message.py'] --There are massive changes between the two files here. Based on the copyright string the micropython implementation is a year newer and is more complete.

./email/parser.py ['./email.parser/email/parser.py'] --These two files are largely the same with a couple of minor differences. The Ouroboros file has a little more error checking.

./email/quoprimime.py ['./email.encoders/email/quoprimime.py'] --These two files have the same layout and try to provide the same functionality. It looks like the Ouroboros file does more error checking.

./email/utils.py ['./email.utils/email/utils.py'] --These two files have the same layout and try to provide the same functionality. The Ouroboros file has a bit more error checking

./fnmatch.py ['./fnmatch/fnmatch.py'] --These two files have the same layout and try to provide the same functionality. The Ouroboros file has a bit more error checking

./formatter.py ['./formatter/formatter.py'] This file is an empty stub in micropython

./fractions.py ['./fractions/fractions.py'] This file is an empty stub in micropython

./ftplib.py ['./ftplib/ftplib.py'] This file is an empty stub in micropython

./functools.py ['./functools/functools.py'] The micropython implementation is largely a dummy implementation.

./getopt.py ['./getopt/getopt.py'] --The files are the same with the exception of a one character change in the comments.

./getpass.py ['./getpass/getpass.py'] --This file is an empty stub in micropython

./gettext.py ['./gettext/gettext.py'] --These files are majorly different. The micropython implementation is essentially a stub.

./glob.py ['./glob/glob.py'] --The two files have the same layout and implementation. Mostly minor differences, but doesn't appear to be functional. Ouroboros implementation also had an escape method.

./gzip.py ['./gzip/gzip.py'] There are major differences here and the Ouroborus implementation is much more complete.

./heapq.py ['./heapq/heapq.py'] The layout and functionality here is mostly the same. The largest differences is a bunch of imports are only done if certain functions are run instead of all the time.

./hmac.py ['./hmac/hmac.py'] There are minor differences between the files, but they look to be functionally equivalent.

./html ['./html', './html/html', './html.entities/html', './html.parser/html']

./html/init.py ['./html/html/init.py'] The same functions are defined in both files, but the Ouroboros file looks to be more complete.

./html/entities.py ['./html.entities/html/entities.py'] --These two files are functionally the same. Minor spelling differences in the comments.

./html/parser.py ['./html.parser/html/parser.py'] --These two files define the same functionality. The unescape function is purposely removed in the Ouroboros copy. There are extra checks throughout the file in the Ouroboros copy.

./http ['./http.client/http']

./http/client.py ['./http.client/http/client.py'] --The two files try to implement all of the same endpoints. The Ouroboros file looks to have more error checking throughout.

./imaplib.py ['./imaplib/imaplib.py'] --The micropython file is an empty dummy file.

./imp.py ['./imp/imp.py'] --The micropython file is an empty dummy file.

./importlib ['./importlib']

./inspect.py ['./inspect/inspect.py'] --The micropython copy is incomplete in comparison. Certain functions are deliberately not implemented.

./io.py ['./io/io.py'] --The Ouroboros file is much more complete and defines many things not in micropython.

./ipaddress.py ['./ipaddress/ipaddress.py'] --This file is an empty stub in micropython

./itertools.py ['./itertools/itertools.py'] --There are a number of differences in the two files. For the same method in some instances they are implemented in two different ways. The Ouroboros file is more complete. For example it includes a method for zip_longest while micropython does not.

./json ['./json', './json/json']

./json/init.py ['./json/json/init.py'] --There are a few changes between the files. Some of the defaults into a function are the opposite between the two files. The same endpoints are defined, but it seems that micropython forcefully tries to make more compact json representations.

./json/decoder.py ['./json/json/decoder.py'] --There are some differences here such as micropython does not implement _decode_uXXXX. Instead that same functionality is defined inline in a different method. Overall it looks like they provide the same functionality.

./json/encoder.py ['./json/json/encoder.py'] --There are a number of differences between the two files. It looks like most of the differences though are more complete error checking in the Ouroboros definition.

./json/scanner.py ['./json/json/scanner.py'] --These two files are the same with two minor changes when an exception is raised.

./json/tool.py ['./json/json/tool.py'] --These files are the same except in one instance micropython includes an extra parameter by default to json.dump.

./keyword.py ['./keyword/keyword.py'] --There are changes between the two files in several places, but it looks like they mostly try to achieve the same functionality.

./linecache.py ['./linecache/linecache.py'] --The micropython implementation is a single line definition for the cache. Ouroboros is more complete.

./locale.py ['./locale/locale.py'] --The Ouroboros file tries to determine the locale. Micropython on the other hand says screw it everything is UTF-8

./logging ['./logging']

./mailbox.py ['./mailbox/mailbox.py'] -- This is an empty stub file in micropython

./mailcap.py ['./mailcap/mailcap.py'] -- This is an empty stub file in micropython

./mimetypes.py ['./mimetypes/mimetypes.py'] -- This is an empty stub file in micropython

./multiprocessing ['./multiprocessing']

./nntplib.py ['./nntplib/nntplib.py'] -- This is an empty stub file in micropython

./numbers.py ['./numbers/numbers.py'] -- This is an empty stub file in micropython

./operator.py ['./operator/operator.py'] --The Ouroboros file is much more complete here and defines a number of methods not present in micropython

./optparse.py ['./optparse/optparse.py'] -- This is an empty stub file in micropython

./pathlib.py ['./pathlib/pathlib.py'] -- This is an empty stub file in micropython

./pdb.py ['./pdb/pdb.py'] -- This is an empty stub file in micropython

./pickle.py ['./pickle/pickle.py'] --Micropython implements a fake pickle which looks trivial and has no error checking.

./pickletools.py ['./pickletools/pickletools.py'] -- This is an empty stub file in micropython

./pkgutil.py ['./pkgutil/pkgutil.py'] --The package file very short and has no error checking. The Ouroboros is much more complete.

./platform.py ['./platform/platform.py'] -- This is an empty stub file in micropython

./poplib.py ['./poplib/poplib.py'] -- This is an empty stub file in micropython

./posixpath.py ['./posixpath/posixpath.py'] -- This is an empty stub file in micropython

./pprint.py ['./pprint/pprint.py'] --In micropython this is a stub that simply returns the repr for an object instead of actually doing pprint.

./profile.py ['./profile/profile.py'] -- This is an empty stub file in micropython

./pty.py ['./pty/pty.py'] -- This is an empty stub file in micropython

./queue.py ['./queue/queue.py'] -- This is an empty stub file in micropython

./quopri.py ['./quopri/quopri.py'] --These files are nearly identical. All of the endpoints are the same. There are wording changes in two comments. There is also a change in an exception clause.

./random.py ['./random/random.py'] --The micropython implementation defines a few methods, but they are trivial implementations. The Ouroboros file is much more complete.

./re.py ['./re-pcre/re.py'] --There are major major changes between the two files in this case. In the micropython case an external file is loaded which I do not seem to have a copy of. Therefore it is hard to compare the two fully.

./reprlib.py ['./reprlib/reprlib.py'] -- This is an empty stub file in micropython. I assume this is due to the external file that is read in when re.py is used.

./runpy.py ['./runpy/runpy.py'] -- This is an empty stub file in micropython

./sched.py ['./sched/sched.py'] -- This is an empty stub file in micropython

./selectors.py ['./selectors/selectors.py'] -- This is an empty stub file in micropython

./shelve.py ['./shelve/shelve.py'] -- This is an empty stub file in micropython

./shlex.py ['./shlex/shlex.py'] -- This is an empty stub file in micropython

./shutil.py ['./shutil/shutil.py'] --There are major differences here. There is a comment in the micropython file:

Reimplement, because CPython3.3 impl is rather bloated

Currently only 2 methods are implemented in micropython. Those are rmtree and copyfileobj

./smtplib.py ['./smtplib/smtplib.py'] -- This is an empty stub file in micropython

./socket.py ['./socket/socket.py'] --There are major differences in implementation here. The micropython version looks to be bare bones with no error checking.

./socketserver.py ['./socketserver/socketserver.py'] -- This is an empty stub file in micropython

./sqlite3 ['./sqlite3']

./ssl.py ['./ssl/ssl.py'] --There are major differences in implementation here. The micropython version looks to be bare bones with no error checking.

./stat.py ['./stat/stat.py'] --These two files are nearly identical. The exception is the following at the bottom of the Ouroboros file:

If available, use C implementation

try: from _stat import * except ImportError: pass

./statistics.py ['./statistics/statistics.py'] -- This is an empty stub file in micropython

./string.py ['./string/string.py'] --There are major differences in implementation here. The micropython version looks to be bare bones with no error checking.

./stringprep.py ['./stringprep/stringprep.py'] -- This is an empty stub file in micropython

./struct.py ['./struct/struct.py'] --I haven't gone through all of the supporting files, but micropython imports from ustruct. Ouroboros on the other hand imports from _struct

./subprocess.py ['./subprocess/subprocess.py'] -- This is an empty stub file in micropython

./tarfile.py ['./tarfile/tarfile.py'] -- This is an empty stub file in micropython

./telnetlib.py ['./telnetlib/telnetlib.py'] -- This is an empty stub file in micropython

./tempfile.py ['./tempfile/tempfile.py'] -- This is an empty stub file in micropython

./test ['./test', './test.pystone/test', './test.support/test']

./test/pystone.py ['./test.pystone/test/pystone.py'] --These two files are identical with the exception of a one character comment

./test/test_argparse.py ['./argparse/test_argparse.py'] --There are massive differences between the two files. This is probably explained by the stripped down implementation of the code it tests

./test/test_base64.py ['./base64/test_base64.py'] --There are massive differences between the two files. This is probably explained by the stripped down implementation of the code it tests

./test/test_binascii.py ['./binascii/test_binascii.py'] --There are massive differences between the two files. This is probably explained by the stripped down implementation of the code it tests

./test/test_datetime.py ['./datetime/test_datetime.py'] --There are massive differences between the two files. This is probably explained by the stripped down implementation of the code it tests

./test/test_defaultdict.py ['./collections.defaultdict/test_defaultdict.py'] --There are massive differences between the two files. This is probably explained by the stripped down implementation of the code it tests

./test/test_fnmatch.py ['./fnmatch/test_fnmatch.py'] --There are only minor changes between the two files. One example is a method that is commented out due to not being implemented.

./test/test_gettext.py ['./gettext/test_gettext.py'] --There are massive differences between the two files. This is probably explained by the stripped down implementation of the code it tests

./test/test_glob.py ['./glob/test_glob.py'] --There are minor differences between the files. This is mostly due to tests being skipped in micropython since they are not supported.

./test/test_hashlib.py ['./hashlib/test_hashlib.py'] --There are major differences in the test run between the two files.

./test/test_heapq.py ['./heapq/test_heapq.py'] --There are major differences between the files. This is mostly due to tests being skipped in micropython since they are not supported.

./test/test_hmac.py ['./hmac/test_hmac.py'] --There are major differences in the test run between the two files.

./test/testimportlib/import/test_path.py ['./os.path/test_path.py'] --There are major differences between the files. Ouroboros has a lot more checks.

./test/test_itertools.py ['./itertools/test_itertools.py'] --There are major differences between the files. This is mostly due to tests being skipped in micropython since they are not supported.

./test/test_operator.py ['./operator/test_operator.py'] --There are major differences between the files. Ouroboros has a lot more checks.

./test/test_pep380.py ['./test/test_pep380.py'] --There are minor differences in the tests. For example one import is commented out in micropython. The other changes seem to be due to things that are not supported in micropython:

MicroPython doesn't support nested exceptions

MicroPython doesn't support assignment to .value

In MicroPython, exceptions is .close() are not ignored/printed to sys.stderr,

but propagated as usual.

@unittest.skip("MicroPython doesn't check for already active generator when resuming it")
@unittest.skip("MicroPython doesn't support inspect.stack()")

./test/test_pickle.py ['./pickle/test_pickle.py'] --There are major differences between the files. This is mostly due to tests being skipped in micropython since they are not supported.

./test/test_quopri.py ['./quopri/test_quopri.py'] --There are only minor differences between the files. Most of the checks are the same

./test/test_re.py ['./re-pcre/test_re.py'] --There are major differences between the files. This is mostly due to tests being skipped in micropython since they I believe they not supported.

./test/test_readline.py ['./uasyncio/test_readline.py'] --There are major differences between the files. Ouroboros has many more checks being done.

./test/test_strftime.py ['./time/test_strftime.py'] --There are major differences between the files. Ouroboros has many more checks being done.

./test/test_unittest.py ['./unittest/test_unittest.py'] --There are major differences between the files. In this case micropython makes many more tests which is typically not the case.

./test/test_urlparse.py ['./urllib.parse/test_urlparse.py'] --There are checks that differ on both sides of this file. Most of the checks appear to be the same, but both have some unique cases.

./test/xmltestdata/test.xml ['./xmltok/test.xml'] --There are major differences between the files. Ouroboros has many more checks being done.

./textwrap.py ['./textwrap/textwrap.py'] These two files are the except minor differences in the comments. There is one more difference which is the else block on line 434 in Ouroboros is not implemented in micropython.

./threading.py ['./threading/threading.py'] --There are major differences between the files. Ouroboros has many more checks being done.

./timeit.py ['./timeit/timeit.py'] --There are some changes between the files, but most of the tests appear to be the same. It looks like in micropython some things may not run since it may be possible to not find itertools

./trace.py ['./trace/trace.py'] --The test file in micropython is an empty stub file.

./traceback.py ['./traceback/traceback.py'] --There are major differences between the files. Ouroboros has many more checks being done.

./tty.py ['./tty/tty.py'] --Micropython only does a single import in the file. Ouroboros implements two other methods.

./types.py ['./types/types.py'] --The Micropython implementation is not as complete due to other missing pieces under the hood. There are things still defined though. For example: CodeType = None # TODO: Add better sentinel which can't match anything MappingProxyType = None # TODO: Add better sentinel which can't match anything SimpleNamespace = None # TODO: Add better sentinel which can't match anything

./unittest ['./unittest']

./urllib ['./urllib', './urllib.parse/urllib', './urllib.urequest/urllib']

./urllib/parse.py ['./urllib.parse/urllib/parse.py'] --There are minor differences between the files, but they look to be mostly functionally equal. A lot of the differences on both sides seem to be delayed imports or definitions only when a function is run.

./uu.py ['./uu/uu.py'] --The two files are the same.

./uuid.py ['./uuid/uuid.py'] --This is an empty stub file in micropython.

./venv ['./venv']

./warnings.py ['./warnings/warnings.py'] --Micropython has a trivial single method implementation here.

./weakref.py ['./weakref/weakref.py'] --Micropython has a trivial single method implementation here.

./zipfile.py ['./zipfile/zipfile.py'] --This is an empty stub file in micropython.

freakboy3742 commented 6 years ago

Thanks for the analysis - from the look of it, this means there isn't much for us to use. The files in micropython are either stubs, or deliberately minimal implementations - which is completely appropriate for micropython, but not helpful for our purposes.