Damien George
d2384efa80
py: Automatically provide weak links from "foo" to "ufoo" module name.
...
This commit implements automatic module weak links for all built-in
modules, by searching for "ufoo" in the built-in module list if "foo"
cannot be found. This means that all modules named "ufoo" are always
available as "foo". Also, a port can no longer add any other weak links,
which makes strict the definition of a weak link.
It saves some code size (about 100-200 bytes) on ports that previously had
lots of weak links.
Some changes from the previous behaviour:
- It doesn't intern the non-u module names (eg "foo" is not interned),
which saves code size, but will mean that "import foo" creates a new qstr
(namely "foo") in RAM (unless the importing module is frozen).
- help('modules') no longer lists non-u module names, only the u-variants;
this reduces duplication in the help listing.
Weak links are effectively the same as having a set of symbolic links on
the filesystem that is searched last. So an "import foo" will search
built-in modules first, then all paths in sys.path, then weak links last,
importing "ufoo" if it exists. Thus a file called "foo.py" somewhere in
sys.path will still have precedence over the weak link of "foo" to "ufoo".
See issues: #1740 , #4449 , #5229 , #5241 .
2019-10-22 15:30:52 +11:00
..
2018-09-20 14:33:10 +10:00
2019-07-12 16:48:37 +10:00
2019-03-08 15:53:05 +11:00
2019-06-28 13:54:45 +10:00
2016-12-09 22:50:58 +11:00
2019-05-01 15:24:21 +10:00
2019-03-08 15:53:05 +11:00
2019-03-08 15:53:05 +11:00
2019-03-08 15:53:05 +11:00
2019-03-08 15:53:05 +11:00
2019-03-08 15:53:05 +11:00
2019-10-05 13:44:53 +10:00
2019-10-05 13:44:08 +10:00
2019-09-26 15:39:50 +10:00
2019-10-01 12:26:22 +10:00
2019-10-01 12:26:22 +10:00
2019-09-02 13:14:27 +10:00
2019-09-02 13:14:27 +10:00
2019-02-14 00:35:45 +11:00
2019-02-12 14:54:51 +11:00
2019-10-22 15:30:52 +11:00
2019-10-22 15:30:52 +11:00
2019-10-05 13:44:53 +10:00
2019-08-28 12:47:58 +10:00
2019-10-05 13:44:53 +10:00
2019-10-01 12:26:22 +10:00
2018-10-28 00:38:18 +11:00
2019-08-30 16:44:12 +10:00
2019-08-30 16:44:12 +10:00
2019-03-14 12:22:25 +11:00
2019-03-14 12:22:25 +11:00
2018-09-04 14:31:28 +10:00
2019-10-05 13:44:53 +10:00
2018-09-04 14:31:28 +10:00
2018-09-04 14:31:28 +10:00
2018-10-01 13:31:11 +10:00
2018-09-04 14:31:28 +10:00
2019-10-05 13:44:53 +10:00
2018-03-01 17:00:02 +11:00
2017-07-31 18:35:40 +10:00
2017-07-31 18:35:40 +10:00
2019-05-17 18:06:11 +10:00
2019-05-17 18:04:15 +10:00
2018-12-20 17:52:16 +11:00
2019-09-26 15:12:39 +10:00
2019-09-26 15:12:39 +10:00
2019-09-26 15:12:39 +10:00
2019-04-12 11:34:52 +10:00
2019-09-26 16:04:56 +10:00
2019-10-04 17:18:56 +10:00
2018-12-22 01:40:38 +11:00
2018-07-09 14:40:02 +10:00
2019-02-12 14:54:51 +11:00
2019-05-09 17:11:33 +10:00
2019-10-21 23:01:41 +11:00
2019-10-21 23:21:04 +11:00
2019-03-08 22:46:43 +11:00
2019-02-12 14:54:51 +11:00
2017-08-30 21:02:00 +10:00
2018-02-21 22:39:25 +11:00
2017-08-30 21:02:00 +10:00
2019-07-31 22:37:44 +10:00
2019-08-17 23:23:17 +10:00
2019-07-17 16:09:32 +10:00
2019-09-02 13:14:27 +10:00
2019-08-30 16:44:12 +10:00
2019-02-12 14:54:51 +11:00
2019-09-26 16:04:56 +10:00
2019-10-22 15:30:52 +11:00
2018-05-01 15:53:25 +10:00
2019-07-01 17:10:12 +10:00
2019-04-23 12:40:15 +10:00
2017-07-31 18:35:40 +10:00
2017-07-31 18:35:40 +10:00
2019-10-01 09:51:02 +10:00
2017-07-18 11:57:39 +10:00
2018-05-21 12:48:26 +10:00
2017-12-29 14:05:48 +11:00
2019-10-05 13:41:58 +10:00
2017-12-29 22:24:53 +11:00
2019-10-05 13:44:53 +10:00
2017-12-28 16:46:30 +11:00
2019-08-19 16:14:33 +10:00
2019-08-19 16:14:57 +10:00
2019-08-19 16:14:57 +10:00
2019-08-19 16:14:57 +10:00
2019-09-26 16:04:56 +10:00
2019-03-08 22:46:43 +11:00
2019-08-15 23:02:04 +10:00
2018-12-20 17:40:48 +11:00
2017-07-31 18:35:40 +10:00
2017-10-04 12:37:50 +11:00
2018-12-06 18:02:41 +11:00
2017-07-31 18:35:40 +10:00
2017-07-31 18:35:40 +10:00
2019-02-12 14:54:51 +11:00
2018-05-11 13:44:50 +10:00
2019-07-30 16:34:27 +10:00
2019-02-12 14:54:51 +11:00
2019-09-26 16:04:56 +10:00
2018-03-17 00:31:40 +11:00
2019-02-12 14:54:51 +11:00
2019-02-12 14:54:51 +11:00
2019-10-01 12:26:22 +10:00
2019-08-30 16:44:12 +10:00
2019-10-05 13:42:39 +10:00
2017-07-31 18:35:40 +10:00
2017-10-04 12:37:50 +11:00
2019-02-12 14:54:51 +11:00
2019-05-06 18:28:28 +10:00
2019-02-12 14:54:51 +11:00
2017-09-18 00:06:43 +03:00
2019-02-12 14:54:51 +11:00
2018-03-13 14:03:15 +11:00
2019-02-12 14:54:51 +11:00
2019-10-22 15:30:52 +11:00
2019-10-22 15:30:52 +11:00
2019-02-12 14:54:51 +11:00
2017-11-20 09:30:06 +02:00
2017-10-04 12:37:50 +11:00
2019-02-12 14:54:51 +11:00
2017-10-04 12:37:50 +11:00
2019-02-12 14:54:51 +11:00
2019-02-12 14:54:51 +11:00
2019-02-12 14:54:51 +11:00
2019-04-15 11:14:22 +10:00
2017-10-04 12:37:50 +11:00
2019-02-12 14:54:51 +11:00
2019-10-22 13:54:09 +11:00
2019-05-21 14:24:04 +10:00
2019-07-17 16:12:19 +10:00
2017-06-09 17:33:01 +03:00
2019-02-12 14:54:51 +11:00
2019-08-31 00:14:11 +10:00
2017-08-29 13:16:30 +10:00
2019-10-18 15:20:56 +11:00
2018-06-08 11:48:25 +10:00
2019-02-12 14:54:51 +11:00
2017-11-24 14:48:23 +11:00
2019-09-26 16:04:56 +10:00
2017-07-31 18:35:40 +10:00
2019-09-26 16:04:56 +10:00
2017-07-31 18:35:40 +10:00
2017-07-31 18:35:40 +10:00
2017-07-31 18:35:40 +10:00
2019-10-15 16:56:27 +11:00
2019-10-05 13:44:53 +10:00
2019-10-01 12:26:22 +10:00
2019-08-30 16:48:47 +10:00
2019-10-15 21:34:23 +11:00
2018-02-19 00:26:14 +11:00
2017-12-11 13:49:09 +11:00
2019-02-19 23:44:01 +11:00
2019-09-26 16:04:56 +10:00
2018-09-20 14:41:35 +10:00
2018-06-06 14:28:23 +10:00
2017-03-14 11:52:05 +11:00
2019-09-26 16:04:56 +10:00
2017-07-31 18:35:40 +10:00
2019-10-01 09:51:02 +10:00
2019-10-01 09:51:02 +10:00
2019-10-05 13:41:58 +10:00
2017-12-05 00:38:41 +02:00
2019-10-04 23:27:00 +10:00
2019-05-29 21:14:24 +10:00
2019-07-17 16:09:32 +10:00
2018-10-28 00:38:18 +11:00
2018-10-28 00:38:18 +11:00
2019-07-25 16:37:25 +10:00
2019-10-01 12:26:22 +10:00
2017-07-31 18:35:40 +10:00
2017-12-11 22:39:12 +11:00
2017-12-11 13:49:09 +11:00
2017-07-31 18:35:40 +10:00
2019-02-06 00:19:00 +11:00
2019-05-17 18:04:15 +10:00
2018-11-26 16:13:08 +11:00
2017-09-06 16:43:09 +10:00
2019-10-04 23:27:00 +10:00
2019-09-26 15:39:50 +10:00
2019-05-17 18:04:15 +10:00
2019-02-06 00:19:00 +11:00