1.1 --- a/lib/__builtins__/core.py Thu Nov 24 00:29:06 2016 +0100
1.2 +++ b/lib/__builtins__/core.py Thu Nov 24 00:58:36 2016 +0100
1.3 @@ -19,18 +19,32 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 +from native import _get_using
1.8 +
1.9 class object:
1.10
1.11 "The root class of all objects except functions."
1.12
1.13 def __init__(self):
1.14 +
1.15 "No-operation."
1.16 +
1.17 pass
1.18
1.19 def __bool__(self):
1.20 +
1.21 "Objects are true by default."
1.22 +
1.23 return True
1.24
1.25 + def __str__(self):
1.26 +
1.27 + "Return a string representation."
1.28 +
1.29 + return self.__name__
1.30 +
1.31 + __repr__ = __str__
1.32 +
1.33 class function:
1.34
1.35 """
1.36 @@ -48,20 +62,40 @@
1.37 self.__args__ = None
1.38
1.39 def __bool__(self):
1.40 +
1.41 "Functions are true by default."
1.42 +
1.43 return True
1.44
1.45 + def __str__(self):
1.46 +
1.47 + "Return a string representation."
1.48 +
1.49 + return "<function>" # NOTE: Could be made specific.
1.50 +
1.51 + __repr__ = __str__
1.52 +
1.53 class type(object):
1.54
1.55 "The class of all classes."
1.56
1.57 - pass
1.58 + def __str__(self):
1.59 +
1.60 + "Return a string representation."
1.61 +
1.62 + return "<type>"
1.63 +
1.64 + __repr__ = __str__
1.65
1.66 class BaseException(object): pass
1.67 class Exception(BaseException): pass
1.68 class UnboundMethodInvocation(Exception): pass
1.69 class Warning(object): pass
1.70
1.71 -def get_using(callable, instance): pass
1.72 +def get_using(callable, instance):
1.73 +
1.74 + "Return 'callable' bound to 'instance'."
1.75 +
1.76 + return _get_using(callable, instance)
1.77
1.78 # vim: tabstop=4 expandtab shiftwidth=4