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
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
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
2020-02-28 10:33:03 +11:00
2020-04-05 15:02:06 +10:00
2020-04-05 15:02:06 +10:00
2020-06-27 00:24:04 +10:00
2020-04-18 22:42:24 +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
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
2020-04-18 22:42:24 +10:00
2020-02-28 10:33:03 +11: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
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
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
2020-04-18 22:36:14 +10:00
2020-06-30 23:55:32 +10:00
2020-06-30 23:55:32 +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
2020-03-26 01:25:45 +11:00
2020-02-11 15:43:13 +11:00
2020-04-23 11:24:25 +10:00
2020-01-13 01:01:45 +11:00
2020-04-05 15:02:06 +10:00
2020-02-28 10:33:03 +11:00
2020-04-05 15:02:06 +10: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
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
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
2020-02-28 10:33:03 +11: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
2020-02-28 10:33:03 +11:00
2020-06-05 14:04:20 +10: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
2020-02-28 10:33:03 +11: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
2020-04-13 21:55:47 +10:00
2020-02-28 10:31:07 +11:00
2020-02-28 10:33:03 +11:00