Commit Graph

59 Commits

Author SHA1 Message Date
Damien George 7efc5b3f34 py: Make globals and locals proper dictionary objects.
Finishes addressing issue #424.

In the end this was a very neat refactor that now makes things a lot
more consistent across the py code base.  It allowed some
simplifications in certain places, now that everything is a dict object.

Also converted builtins tables to dictionaries.  This will be useful
when we need to turn builtins into a proper module.
2014-04-05 22:36:42 +01:00
Paul Sokolovsky c6813d92db py: Put default namespace into module __main__.
That's how CPython has it, in particular, "import __main__" should work.
2014-04-05 12:29:15 +03:00
Paul Sokolovsky 98a627dc03 py: Add "io" module.
So far just includes "open" function, which should be supplied by a port.

TODO: Make the module #ifdef'ed.
2014-04-03 22:08:57 +03:00
Damien George 3e1a5c10c5 py: Rename old const type objects to mp_type_* for consistency. 2014-03-29 13:43:38 +00:00
Damien George 07ddab529c py: Change mp_const_* objects to macros.
Addresses issue #388.
2014-03-29 13:15:08 +00:00
Damien George c63f984647 py: Thin out predefined exceptions.
Only exceptions that are actually used are left prefedined.  Hierarchy
is still there, and removed exceptions are just commented out.
2014-03-27 23:49:06 +00:00
Paul Sokolovsky e9137b94f2 py: Implement getattr() builtin. 2014-03-27 00:11:36 +02:00
Damien George ffb5cfc8d8 py: Removed some unnecessary exception objects.
They still exist in commented-out form in objexcept.c if they are ever
needed.
2014-03-25 14:29:40 +00:00
Damien George caac542b23 Proper support for registering builtin modules in ROM.
Comes with some refactoring of code and renaming of files.  All modules
are now named mod*.[ch].
2014-03-25 14:18:18 +00:00