golang: Fix `@func(cls) def name` not to set `name` in calling context

This is take 2 after 924a808c (golang: Fix `@func(cls) def name` not to
override `name` in calling context). There we fixed it not to override
name if name was already set, but for the case of unset name it was
still set. The following example was thus not working correctly as
builtin `next` was shadowed:

    class BitSync

    @func(BitSync)
    def next(): ...         # this was shadowing access to builtin next

    def peek(seq):
        return next(...)    # here next was taken not from builtin, but
                            # from result of above shadowing

To solve the problem in the patch from 2019 I initially contemplated
patching bytecode because python unconditionally does STORE_NAME after a
function is defined with decorator:

    In [2]: c = """
       ...: @fff
       ...: def ccc():
       ...:     return 1
       ...: """

    In [3]: cc = compile(c, "file", "exec")

    In [4]: dis(cc)
      2           0 LOAD_NAME                0 (fff)
                  3 LOAD_CONST               0 (<code object ccc at 0x7fafe58d0130, file "file", line 2>)
                  6 MAKE_FUNCTION            0
                  9 CALL_FUNCTION            1
                 12 STORE_NAME               1 (ccc)	<-- NOTE means: ccc = what fff() call returns
                 15 LOAD_CONST               1 (None)
                 18 RETURN_VALUE

However after hitting this problem for real again and taking a fresh
look I found a way to arrange for the good end result without bytecode
magic: if name is initially unset @func can install its own custom
object, which, when overwritten by normal python codeflow of invoking
STORE_NAME after decorator, unsets the attribute.

That works quite ok and the patch with the fix is small.

/cc @jerome
/proposed-for-review-on !28
322 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
passed Pygolang.UnitTest-Master.Python2

00:01:42

failed Pygolang.UnitTest-Master.Python3

00:02:09

failed Pygolang.UnitTest-Master.Python2

00:05:41

passed Pygolang.UnitTest-Master.Python2

00:01:27

passed Pygolang.UnitTest-Master.Python2

00:01:51

failed Pygolang.UnitTest-Master.Python2

00:05:11

failed Pygolang.UnitTest-Master.Python2

00:26:06

failed Pygolang.UnitTest-Master.Python2

00:05:43

failed Pygolang.UnitTest-Master.Python2

00:04:58

failed Pygolang.UnitTest-Master.Python2

00:05:27

failed Pygolang.UnitTest-Master.Python2

00:05:32

failed Pygolang.UnitTest-Master.Python2

00:05:19

failed Pygolang.UnitTest-Master.Python2

00:05:51

failed Pygolang.UnitTest-Master.Python2

00:06:05

failed Pygolang.UnitTest-Master.Python2

00:05:42

failed Pygolang.UnitTest-Master.Python2

00:05:19

failed Pygolang.UnitTest-Master.Python2

00:04:53

failed Pygolang.UnitTest-Master.Python2

00:24:17

failed Pygolang.UnitTest-Master.Python2

00:05:21

failed Pygolang.UnitTest-Master.Python2

00:05:02

failed Pygolang.UnitTest-Master.Python2

00:04:05

failed Pygolang.UnitTest-Master.Python2

00:03:48

failed Pygolang.UnitTest-Master.Python2

00:08:03

failed Pygolang.UnitTest-Master.Python2

00:04:19

failed Pygolang.UnitTest-Master.Python2

00:05:07

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:04:38

failed Pygolang.UnitTest-Master.Python2

00:04:48

passed Pygolang.UnitTest-Master.Python2

00:55:47

passed Pygolang.UnitTest-Master.Python2

00:01:36

passed Pygolang.UnitTest-Master.Python2

00:01:28

passed Pygolang.UnitTest-Master.Python2

00:02:19

passed Pygolang.UnitTest-Master.Python2

00:01:31

passed Pygolang.UnitTest-Master.Python2

00:01:51

passed Pygolang.UnitTest-Master.Python2

00:01:49

passed Pygolang.UnitTest-Master.Python2

00:01:31

failed Pygolang.UnitTest-Master.Python2

00:05:22

failed Pygolang.UnitTest-Master.Python2

00:03:49

failed Pygolang.UnitTest-Master.Python2

00:04:04

failed Pygolang.UnitTest-Master.Python2

00:03:59

failed Pygolang.UnitTest-Master.Python2

00:03:43

failed Pygolang.UnitTest-Master.Python2

00:03:42

failed Pygolang.UnitTest-Master.Python2

00:03:35

failed Pygolang.UnitTest-Master.Python2

00:04:26

failed Pygolang.UnitTest-Master.Python2

00:04:01

failed Pygolang.UnitTest-Master.Python2

00:03:56

failed Pygolang.UnitTest-Master.Python2

00:19:23

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:03:42

failed Pygolang.UnitTest-Master.Python2

00:05:01

failed Pygolang.UnitTest-Master.Python2

00:04:46

failed Pygolang.UnitTest-Master.Python2

00:04:24

failed Pygolang.UnitTest-Master.Python2

00:04:19

failed Pygolang.UnitTest-Master.Python2

00:04:05

failed Pygolang.UnitTest-Master.Python2

00:03:49

failed Pygolang.UnitTest-Master.Python2

00:04:49

failed Pygolang.UnitTest-Master.Python2

00:03:44

failed Pygolang.UnitTest-Master.Python2

00:18:17

failed Pygolang.UnitTest-Master.Python2

00:03:47

failed Pygolang.UnitTest-Master.Python2

00:04:14

failed Pygolang.UnitTest-Master.Python2

00:03:58

failed Pygolang.UnitTest-Master.Python2

00:03:50

failed Pygolang.UnitTest-Master.Python2

00:03:56

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:04:30

failed Pygolang.UnitTest-Master.Python2

00:04:22

failed Pygolang.UnitTest-Master.Python2

00:04:44

failed Pygolang.UnitTest-Master.Python2

00:04:15

failed Pygolang.UnitTest-Master.Python2

00:21:28

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:04:14

failed Pygolang.UnitTest-Master.Python2

00:04:21

failed Pygolang.UnitTest-Master.Python2

00:04:17

failed Pygolang.UnitTest-Master.Python2

00:04:51

failed Pygolang.UnitTest-Master.Python2

00:04:23

failed Pygolang.UnitTest-Master.Python2

00:03:49

failed Pygolang.UnitTest-Master.Python2

00:03:57

failed Pygolang.UnitTest-Master.Python2

00:04:49

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:19:38

failed Pygolang.UnitTest-Master.Python2

00:04:13

failed Pygolang.UnitTest-Master.Python2

00:04:15

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:03:28

failed Pygolang.UnitTest-Master.Python2

00:04:05

failed Pygolang.UnitTest-Master.Python2

00:03:52

failed Pygolang.UnitTest-Master.Python2

00:04:17

failed Pygolang.UnitTest-Master.Python2

00:03:34

failed Pygolang.UnitTest-Master.Python2

00:03:51

failed Pygolang.UnitTest-Master.Python2

00:03:59

failed Pygolang.UnitTest-Master.Python2

00:22:02

failed Pygolang.UnitTest-Master.Python2

00:03:52

failed Pygolang.UnitTest-Master.Python2

00:03:52

failed Pygolang.UnitTest-Master.Python2

00:05:56

failed Pygolang.UnitTest-Master.Python2

00:04:22

failed Pygolang.UnitTest-Master.Python2

00:04:29

failed Pygolang.UnitTest-Master.Python2

00:04:30

failed Pygolang.UnitTest-Master.Python2

00:04:25

failed Pygolang.UnitTest-Master.Python2

00:24:52

failed Pygolang.UnitTest-Master.Python2

00:04:54

failed Pygolang.UnitTest-Master.Python2

00:04:20

failed Pygolang.UnitTest-Master.Python2

00:04:48

failed Pygolang.UnitTest-Master.Python2

00:04:13

failed Pygolang.UnitTest-Master.Python2

00:04:13

failed Pygolang.UnitTest-Master.Python2

00:04:07

failed Pygolang.UnitTest-Master.Python2

00:04:29

failed Pygolang.UnitTest-Master.Python2

00:04:40

failed Pygolang.UnitTest-Master.Python2

00:04:44

failed Pygolang.UnitTest-Master.Python2

00:25:23

failed Pygolang.UnitTest-Master.Python2

00:04:23

failed Pygolang.UnitTest-Master.Python2

00:04:11

failed Pygolang.UnitTest-Master.Python2

00:04:06

failed Pygolang.UnitTest-Master.Python2

00:03:51

failed Pygolang.UnitTest-Master.Python2

00:19:52

failed Pygolang.UnitTest-Master.Python2

00:04:17

failed Pygolang.UnitTest-Master.Python2

00:04:18

failed Pygolang.UnitTest-Master.Python2

00:03:49

failed Pygolang.UnitTest-Master.Python2

00:04:20

failed Pygolang.UnitTest-Master.Python2

00:03:32

failed Pygolang.UnitTest-Master.Python2

00:04:19

failed Pygolang.UnitTest-Master.Python2

00:04:06

failed Pygolang.UnitTest-Master.Python2

00:04:58

failed Pygolang.UnitTest-Master.Python2

00:03:38

failed Pygolang.UnitTest-Master.Python2

00:03:54

failed Pygolang.UnitTest-Master.Python2

00:14:26

passed Pygolang.UnitTest-Master.Python2

00:01:33

passed Pygolang.UnitTest-Master.Python2

00:01:34

passed Pygolang.UnitTest-Master.Python2

00:01:50

passed Pygolang.UnitTest-Master.Python2

00:01:22

passed Pygolang.UnitTest-Master.Python2

00:28:39

passed Pygolang.UnitTest-Master.Python2

00:01:49

passed Pygolang.UnitTest-Master.Python2

00:01:24

passed Pygolang.UnitTest-Master.Python2

00:01:25

passed Pygolang.UnitTest-Master.Python2

00:01:35

passed Pygolang.UnitTest-Master.Python2

00:01:50

passed Pygolang.UnitTest-Master.Python2

00:52:45

passed Pygolang.UnitTest-Master.Python2

00:01:43

passed Pygolang.UnitTest-Master.Python2

00:01:25

passed Pygolang.UnitTest-Master.Python2

00:01:31

passed Pygolang.UnitTest-Master.Python2

00:01:38

passed Pygolang.UnitTest-Master.Python2

00:01:37

passed Pygolang.UnitTest-Master.Python2

00:01:43

passed Pygolang.UnitTest-Master.Python2

00:01:26

passed Pygolang.UnitTest-Master.Python2

00:01:24

passed Pygolang.UnitTest-Master.Python2

00:03:11

passed Pygolang.UnitTest-Master.Python2

00:01:35

passed Pygolang.UnitTest-Master.Python2

00:01:33

passed Pygolang.UnitTest-Master.Python2

00:01:38

passed Pygolang.UnitTest-Master.Python2

00:01:41

failed Pygolang.UnitTest-Master.Python2

00:01:49

passed Pygolang.UnitTest-Master.Python2

00:01:43

passed Pygolang.UnitTest-Master.Python2

00:01:19

passed Pygolang.UnitTest-Master.Python2

00:01:37

passed Pygolang.UnitTest-Master.Python2

00:01:24

passed Pygolang.UnitTest-Master.Python2

00:01:42

passed Pygolang.UnitTest-Master.Python2

00:01:38

passed Pygolang.UnitTest-Master.Python2

00:01:39

passed Pygolang.UnitTest-Master.Python2

00:01:43

passed Pygolang.UnitTest-Master.Python2

00:01:31

passed Pygolang.UnitTest-Master.Python2

00:01:31

passed Pygolang.UnitTest-Master.Python2

00:01:35

passed Pygolang.UnitTest-Master.Python2

00:21:25

failed Pygolang.UnitTest-Master.Python2

00:01:25

passed Pygolang.UnitTest-Master.Python2

01:10:24

passed Pygolang.UnitTest-Master.Python2

00:01:50

passed Pygolang.UnitTest-Master.Python2

00:19:07

passed Pygolang.UnitTest-Master.Python2

00:01:37

passed Pygolang.UnitTest-Master.Python2

00:47:44

passed Pygolang.UnitTest-Master.Python2

00:04:07

failed Pygolang.UnitTest-Master.Python2

00:05:07

failed Pygolang.UnitTest-Master.Python2

00:04:46

failed Pygolang.UnitTest-Master.Python2

00:04:47

failed Pygolang.UnitTest-Master.Python2

00:20:26

failed Pygolang.UnitTest-Master.Python2

00:04:45

failed Pygolang.UnitTest-Master.Python2

00:04:20

failed Pygolang.UnitTest-Master.Python2

00:04:57

failed Pygolang.UnitTest-Master.Python2

00:05:15

failed Pygolang.UnitTest-Master.Python2

00:04:13

failed Pygolang.UnitTest-Master.Python2

00:04:56

failed Pygolang.UnitTest-Master.Python2

00:05:08

failed Pygolang.UnitTest-Master.Python2

00:04:46

failed Pygolang.UnitTest-Master.Python2

00:05:06

failed Pygolang.UnitTest-Master.Python2

00:24:27

failed Pygolang.UnitTest-Master.Python2

00:04:37

failed Pygolang.UnitTest-Master.Python2

00:04:09

failed Pygolang.UnitTest-Master.Python2

00:05:31

failed Pygolang.UnitTest-Master.Python2

00:04:17

failed Pygolang.UnitTest-Master.Python2

00:04:16

failed Pygolang.UnitTest-Master.Python2

00:05:01

failed Pygolang.UnitTest-Master.Python2

00:05:09

failed Pygolang.UnitTest-Master.Python2

00:04:52

failed Pygolang.UnitTest-Master.Python2

00:03:52

failed Pygolang.UnitTest-Master.Python3

00:02:15

failed Pygolang.UnitTest-Master.Python3

00:37:21

failed Pygolang.UnitTest-Master.Python3

00:01:47

failed Pygolang.UnitTest-Master.Python3

00:05:48

failed Pygolang.UnitTest-Master.Python3

00:02:13

failed Pygolang.UnitTest-Master.Python3

00:02:06

failed Pygolang.UnitTest-Master.Python3

00:01:48

failed Pygolang.UnitTest-Master.Python3

00:06:16

failed Pygolang.UnitTest-Master.Python3

00:02:13

failed Pygolang.UnitTest-Master.Python3

00:05:45

failed Pygolang.UnitTest-Master.Python3

00:02:15

failed Pygolang.UnitTest-Master.Python3

00:05:00

failed Pygolang.UnitTest-Master.Python3

00:01:47

failed Pygolang.UnitTest-Master.Python3

00:01:51

failed Pygolang.UnitTest-Master.Python3

00:04:53

failed Pygolang.UnitTest-Master.Python3

00:04:59

failed Pygolang.UnitTest-Master.Python3

00:01:46

failed Pygolang.UnitTest-Master.Python3

00:43:43

failed Pygolang.UnitTest-Master.Python3

00:48:02

failed Pygolang.UnitTest-Master.Python3

00:05:18

failed Pygolang.UnitTest-Master.Python3

00:01:54

failed Pygolang.UnitTest-Master.Python3

00:02:18

failed Pygolang.UnitTest-Master.Python3

00:02:08

failed Pygolang.UnitTest-Master.Python3

00:04:30

failed Pygolang.UnitTest-Master.Python3

00:03:09

failed Pygolang.UnitTest-Master.Python3

00:05:59

failed Pygolang.UnitTest-Master.Python3

00:01:48

failed Pygolang.UnitTest-Master.Python3

00:01:54

failed Pygolang.UnitTest-Master.Python3

00:02:29

failed Pygolang.UnitTest-Master.Python3

00:03:58

failed Pygolang.UnitTest-Master.Python3

00:02:24

failed Pygolang.UnitTest-Master.Python3

00:02:15

failed Pygolang.UnitTest-Master.Python3

00:01:45

failed Pygolang.UnitTest-Master.Python3

00:02:03

failed Pygolang.UnitTest-Master.Python3

00:02:19

failed Pygolang.UnitTest-Master.Python3

00:04:24

failed Pygolang.UnitTest-Master.Python3

00:01:50

failed Pygolang.UnitTest-Master.Python3

00:06:34

failed Pygolang.UnitTest-Master.Python3

00:02:09

failed Pygolang.UnitTest-Master.Python3

00:02:53

failed Pygolang.UnitTest-Master.Python3

00:05:53

failed Pygolang.UnitTest-Master.Python3

00:01:55

failed Pygolang.UnitTest-Master.Python3

00:03:25

failed Pygolang.UnitTest-Master.Python3

00:02:47

failed Pygolang.UnitTest-Master.Python3

00:06:19

failed Pygolang.UnitTest-Master.Python3

00:01:57

failed Pygolang.UnitTest-Master.Python3

00:01:56

failed Pygolang.UnitTest-Master.Python3

00:01:58

failed Pygolang.UnitTest-Master.Python3

00:02:22

failed Pygolang.UnitTest-Master.Python3

00:02:01

failed Pygolang.UnitTest-Master.Python3

00:39:32

failed Pygolang.UnitTest-Master.Python3

00:02:05

failed Pygolang.UnitTest-Master.Python3

00:06:18

failed Pygolang.UnitTest-Master.Python3

00:05:56

failed Pygolang.UnitTest-Master.Python3

00:02:28

failed Pygolang.UnitTest-Master.Python3

00:06:10

failed Pygolang.UnitTest-Master.Python3

00:02:18

failed Pygolang.UnitTest-Master.Python3

01:06:39

failed Pygolang.UnitTest-Master.Python3

00:49:48

failed Pygolang.UnitTest-Master.Python3

00:05:50

failed Pygolang.UnitTest-Master.Python3

00:50:14

failed Pygolang.UnitTest-Master.Python3

00:05:31

failed Pygolang.UnitTest-Master.Python3

00:04:47

failed Pygolang.UnitTest-Master.Python3

00:02:25

failed Pygolang.UnitTest-Master.Python3

00:02:04

failed Pygolang.UnitTest-Master.Python3

00:46:33

failed Pygolang.UnitTest-Master.Python3

00:04:53

failed Pygolang.UnitTest-Master.Python3

00:21:28

failed Pygolang.UnitTest-Master.Python3

00:05:53

failed Pygolang.UnitTest-Master.Python3

00:05:56

failed Pygolang.UnitTest-Master.Python3

00:25:54

failed Pygolang.UnitTest-Master.Python3

00:05:48

failed Pygolang.UnitTest-Master.Python3

00:05:49

failed Pygolang.UnitTest-Master.Python3

00:05:33

failed Pygolang.UnitTest-Master.Python3

00:04:08

failed Pygolang.UnitTest-Master.Python3

00:04:36

failed Pygolang.UnitTest-Master.Python3

00:06:09

failed Pygolang.UnitTest-Master.Python3

00:02:09

failed Pygolang.UnitTest-Master.Python3

00:05:23

failed Pygolang.UnitTest-Master.Python3

00:05:46

failed Pygolang.UnitTest-Master.Python3

00:05:14

failed Pygolang.UnitTest-Master.Python3

00:04:20

failed Pygolang.UnitTest-Master.Python3

00:05:46

failed Pygolang.UnitTest-Master.Python3

00:01:53

failed Pygolang.UnitTest-Master.Python3

00:04:58

failed Pygolang.UnitTest-Master.Python3

00:05:24

failed Pygolang.UnitTest-Master.Python3

00:04:35

failed Pygolang.UnitTest-Master.Python3

00:06:23

failed Pygolang.UnitTest-Master.Python3

00:06:05

failed Pygolang.UnitTest-Master.Python3

00:05:16

failed Pygolang.UnitTest-Master.Python3

00:05:19

failed Pygolang.UnitTest-Master.Python3

00:28:49

failed Pygolang.UnitTest-Master.Python3

00:04:43

failed Pygolang.UnitTest-Master.Python3

00:04:21

failed Pygolang.UnitTest-Master.Python3

00:04:26

failed Pygolang.UnitTest-Master.Python3

00:02:07

failed Pygolang.UnitTest-Master.Python3

00:04:48

failed Pygolang.UnitTest-Master.Python3

00:04:58

failed Pygolang.UnitTest-Master.Python3

00:05:53

failed Pygolang.UnitTest-Master.Python3

00:26:45

failed Pygolang.UnitTest-Master.Python3

00:05:56

failed Pygolang.UnitTest-Master.Python3

00:04:59

failed Pygolang.UnitTest-Master.Python3

00:04:19

failed Pygolang.UnitTest-Master.Python3

00:02:27

failed Pygolang.UnitTest-Master.Python3

00:02:06

failed Pygolang.UnitTest-Master.Python3

00:05:42

failed Pygolang.UnitTest-Master.Python3

00:06:44

failed Pygolang.UnitTest-Master.Python3

00:06:30

failed Pygolang.UnitTest-Master.Python3

00:07:06

failed Pygolang.UnitTest-Master.Python3

00:04:13

failed Pygolang.UnitTest-Master.Python3

00:06:00

failed Pygolang.UnitTest-Master.Python3

00:39:48

failed Pygolang.UnitTest-Master.Python3

00:06:27

failed Pygolang.UnitTest-Master.Python3

00:07:15

failed Pygolang.UnitTest-Master.Python3

00:03:49

failed Pygolang.UnitTest-Master.Python3

00:03:17

failed Pygolang.UnitTest-Master.Python3

00:32:23

failed Pygolang.UnitTest-Master.Python3

00:07:02

failed Pygolang.UnitTest-Master.Python3

00:04:23

failed Pygolang.UnitTest-Master.Python3

00:27:26

failed Pygolang.UnitTest-Master.Python3

00:07:18

failed Pygolang.UnitTest-Master.Python3

00:02:18

failed Pygolang.UnitTest-Master.Python3

00:04:51

failed Pygolang.UnitTest-Master.Python3

00:05:35

failed Pygolang.UnitTest-Master.Python3

00:04:29

failed Pygolang.UnitTest-Master.Python3

00:30:40

failed Pygolang.UnitTest-Master.Python3

00:06:39

failed Pygolang.UnitTest-Master.Python3

00:04:47

failed Pygolang.UnitTest-Master.Python3

00:05:43

failed Pygolang.UnitTest-Master.Python3

00:05:48