Damien George
332d83343f
py: Rework mp_convert_member_lookup to properly handle built-ins.
...
This commit fixes lookups of class members to make it so that built-in
functions that are used as methods/functions of a class work correctly.
The mp_convert_member_lookup() function is pretty much completely changed
by this commit, but for the most part it's just reorganised and the
indenting changed. The functional changes are:
- staticmethod and classmethod checks moved to later in the if-logic,
because they are less common and so should be checked after the more
common cases.
- The explicit mp_obj_is_type(member, &mp_type_type) check is removed
because it's now subsumed by other, more general tests in this function.
- MP_TYPE_FLAG_BINDS_SELF and MP_TYPE_FLAG_BUILTIN_FUN type flags added to
make the checks in this function much simpler (now they just test this
bit in type->flags).
- An extra check is made for mp_obj_is_instance_type(type) to fix lookup of
built-in functions.
Fixes #1326 and #6198 .
Signed-off-by: Damien George <damien@micropython.org>
2020-06-30 23:55:32 +10:00
..
2020-04-05 15:02:06 +10:00
2020-06-27 00:24:04 +10:00
2020-06-27 00:24:04 +10:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-06-27 00:24:04 +10:00
2020-06-27 00:24:04 +10:00
2020-06-27 00:24:04 +10:00
2020-06-27 00:24:04 +10:00
2020-06-27 00:24:04 +10:00
2020-02-28 10:33:03 +11:00
2020-06-27 00:24:04 +10:00
2020-02-28 10:29:32 +11:00
2020-04-05 15:02:06 +10:00
2020-04-23 11:24:25 +10:00
2020-04-18 22:42:24 +10:00
2019-09-02 13:14:27 +10:00
2020-03-26 01:25:45 +11:00
2020-04-05 15:02:06 +10:00
2020-02-28 10:33:03 +11:00
2020-04-23 11:24:25 +10:00
2020-06-16 23:18:01 +10:00
2019-08-28 12:47:58 +10:00
2020-06-08 09:05:03 +02:00
2020-04-05 14:13:02 +10:00
2020-02-28 10:33:03 +11:00
2020-04-23 11:24:25 +10:00
2018-10-28 00:38:18 +11:00
2020-02-28 10:33:03 +11:00
2019-08-30 16:44:12 +10:00
2020-04-05 15:02:06 +10:00
2020-04-05 15:02:06 +10:00
2018-09-04 14:31:28 +10:00
2020-06-27 00:24:04 +10:00
2018-09-04 14:31:28 +10:00
2018-09-04 14:31:28 +10:00
2019-12-12 20:15:28 +11:00
2018-09-04 14:31:28 +10:00
2019-10-05 13:44:53 +10:00
2020-04-18 22:42:24 +10:00
2017-07-31 18:35:40 +10:00
2020-02-28 10:33:03 +11:00
2019-05-17 18:06:11 +10:00
2020-04-23 11:24:25 +10:00
2018-12-20 17:52:16 +11:00
2020-06-16 23:18:01 +10:00
2020-06-16 22:02:24 +10:00
2020-06-16 22:02:24 +10:00
2020-04-20 10:32:49 +10:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-04-05 14:20:57 +10:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-04-27 23:53:17 +10:00
2020-06-22 13:42:24 +10:00
2020-01-12 10:34:10 +11:00
2020-04-14 22:13:11 +10:00
2020-02-28 10:33:03 +11:00
2020-06-02 15:42:20 +10:00
2020-04-23 11:24:25 +10:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-04-27 23:58:46 +10:00
2020-05-28 09:54:54 +10:00
2020-04-05 15:02:06 +10:00
2020-04-05 15:02:06 +10:00
2020-05-28 10:02:14 +10:00
2020-04-05 15:02:06 +10:00
2020-04-23 11:24:25 +10:00
2020-06-16 22:02:24 +10:00
2018-05-01 15:53:25 +10:00
2019-07-01 17:10:12 +10:00
2020-04-18 22:42:24 +10:00
2020-02-28 10:33:03 +11:00
2017-07-31 18:35:40 +10:00
2020-01-23 13:29:11 +11:00
2020-02-28 10:33:03 +11:00
2020-04-23 11:24:25 +10:00
2020-03-11 14:34:40 +11:00
2020-04-18 22:36:14 +10:00
2020-05-14 21:48:05 +10:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:31:07 +11:00
2020-02-28 10:33:03 +11:00
2017-12-28 16:46:30 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-06-27 01:03:10 +10:00
2020-06-30 23:55:32 +10:00
2020-04-18 22:42:19 +10:00
2018-12-20 17:40:48 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-06-30 23:55:32 +10:00
2020-06-27 01:03:10 +10:00
2020-04-05 15:02:06 +10:00
2020-06-24 12:05:00 +10:00
2020-02-28 10:33:03 +11:00
2020-04-14 22:13:11 +10:00
2020-02-28 10:33:03 +11:00
2019-02-12 14:54:51 +11:00
2020-04-18 22:36:14 +10:00
2020-06-30 23:55:32 +10:00
2019-08-30 16:44:12 +10:00
2020-06-30 23:55:32 +10:00
2017-07-31 18:35:40 +10:00
2020-02-28 10:33:03 +11:00
2020-05-28 10:02:14 +10:00
2020-05-28 10:02:14 +10:00
2020-04-18 22:42:24 +10:00
2020-05-28 10:02:14 +10:00
2020-04-05 15:02:06 +10:00
2018-03-13 14:03:15 +11:00
2019-02-12 14:54:51 +11:00
2020-03-26 01:25:45 +11:00
2020-02-11 15:43:13 +11:00
2020-04-23 11:24:25 +10:00
2017-11-20 09:30:06 +02:00
2020-01-13 01:01:45 +11:00
2020-04-05 15:02:06 +10:00
2017-10-04 12:37:50 +11:00
2020-02-28 10:33:03 +11:00
2020-04-05 15:02:06 +10:00
2019-02-12 14:54:51 +11:00
2020-04-05 15:02:06 +10:00
2019-12-27 12:53:36 +11:00
2020-04-13 22:19:37 +10:00
2020-04-23 11:24:25 +10:00
2020-02-28 10:33:03 +11:00
2020-04-05 15:02:06 +10:00
2017-06-09 17:33:01 +03:00
2020-04-05 15:02:06 +10:00
2020-04-05 15:02:06 +10:00
2020-02-28 10:33:03 +11:00
2020-06-24 12:05:40 +10:00
2019-12-27 12:34:22 +11:00
2019-02-12 14:54:51 +11:00
2020-01-09 11:25:26 +11:00
2020-03-26 01:21:04 +11:00
2020-03-26 01:21:04 +11:00
2020-05-09 00:55:44 +10:00
2020-05-09 00:55:44 +10:00
2020-04-18 22:36:14 +10:00
2017-07-31 18:35:40 +10:00
2020-02-28 10:33:03 +11:00
2017-07-31 18:35:40 +10:00
2020-04-05 15:02:06 +10:00
2019-12-12 20:15:28 +11:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-05-27 23:10:23 +10:00
2020-02-28 10:33:03 +11:00
2020-02-28 10:33:03 +11:00
2020-04-05 15:02:06 +10:00
2020-04-05 14:20:57 +10:00
2020-02-28 10:31:07 +11:00
2020-02-28 10:33:03 +11:00
2017-03-14 11:52:05 +11:00
2020-02-28 10:33:03 +11:00
2017-07-31 18:35:40 +10:00
2019-11-21 12:04:53 +11:00
2020-06-05 14:04:20 +10:00
2019-12-12 20:15:28 +11:00
2017-12-05 00:38:41 +02:00
2020-06-30 23:55:32 +10:00
2020-05-08 23:20:45 +10:00
2020-05-08 23:20:45 +10:00
2020-04-13 22:27:27 +10:00
2020-06-16 21:42:37 +10:00
2020-04-05 15:02:06 +10:00
2020-02-28 10:33:03 +11:00
2017-07-31 18:35:40 +10:00
2017-12-11 22:39:12 +11:00
2020-02-28 10:33:03 +11:00
2017-07-31 18:35:40 +10:00
2020-04-27 23:58:46 +10:00
2020-03-25 01:00:52 +11:00
2020-02-28 10:33:03 +11:00
2017-09-06 16:43:09 +10:00
2020-04-13 21:55:47 +10:00
2020-02-28 10:31:07 +11:00
2020-02-28 10:33:03 +11:00
2019-02-06 00:19:00 +11:00