3 ms·
> There's only one Maybe to you. Not to me. And not, I suspect, to most of the programmers in this discussion. > Python doesn't have this. Sure it does: c
by pdonis 10y ago
> There's only one
Maybe to you. Not to me. And not, I suspect, to most of the programmers in this discussion.
> Python doesn't have this.
Sure it does:
class NerfedInteger(object):
def __init__(self, i):
self.__i = i
def __repr__(self):
return "<NerfedInteger({})>".format(self.__i)
def __str__(self):
return str(self.__i)
@property
def i(self):
return self.__i
- catnaroek 10y agoWhat you've implemented isn't an abstract type. You can inspect the internal representation anytime, distinguishing between things that were meant never to be distinguished.