Commit 262f8986 authored by Kirill Smelkov's avatar Kirill Smelkov

golang: Kill @method

It was deprecated and scheduled to be removed in 942ee900 (golang:
Deprecate @method(cls) in favour of @func(cls)).
parent 0f60aa77
......@@ -30,7 +30,7 @@
__version__ = "0.0.0.dev8"
__all__ = ['method', 'go', 'chan', 'select', 'default', 'defer', 'panic', 'recover', 'func', 'gimport']
__all__ = ['go', 'chan', 'select', 'default', 'defer', 'panic', 'recover', 'func', 'gimport']
from golang._gopath import gimport # make gimport available from golang
import inspect, threading, collections, random, sys
......@@ -61,12 +61,6 @@ class _PanicError(Exception):
def method(cls):
from warnings import warn
warn("@method(cls) is deprecated in favour of @func(cls)", DeprecationWarning, stacklevel=2)
return func(cls)
# @func is a necessary decorator for functions for selected golang features to work.
# For example it is required by defer. Usage:
......@@ -18,7 +18,7 @@
# See COPYING file for full licensing terms.
# See for rationale and options.
from golang import go, chan, select, default, _PanicError, func, method, panic, defer, recover
from golang import go, chan, select, default, _PanicError, func, panic, defer, recover
from pytest import raises
from os.path import dirname
import os, sys, time, threading, inspect, subprocess
......@@ -414,7 +414,7 @@ def test_method():
def __init__(self, v):
self.v = v
@method(MyClass) # @method(cls) = @func(cls); deprecated and to be removed
def zzz(self, v, x=2, **kkkkwww):
assert self.v == v
return v + 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment