New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Useless cache in EventType #202
Comments
Good question. If we don't use this anywhere let's just delete it. I trust
you''ve grokked the codebase and found we don't use this at all :)
James Mills / prologic
E: prologic@shortcircuit.net.au
W: prologic.shortcircuit.net.au
…On Fri, Jan 20, 2017 at 10:43 PM, Florian Apolloner < ***@***.***> wrote:
Currently EventType looks like this:
class EventType(type):
__cache__ = {}
def __new__(cls, name, bases, ns):
key = (cls, name, bases)
try:
return cls.__cache__[key]
except KeyError:
cls = type.__new__(cls, name, bases, ns)
setattr(cls, "name", ns.get("name", cls.__name__))
return cls
I couldn't find any code setting something in the __cache__ -- should we
just delete it or actually try using it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#202>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABOv-uANip7hdgaLFCI78T2Ez_uaqEajks5rUTiFgaJpZM4Lp1D1>
.
|
The whole class is useless in python3 because it is defined via |
Guess we should add a test and use |
we already do this |
Probably the meta class might not be required.
…On Sat, Jan 21, 2017 at 11:24 Florian Apolloner ***@***.***> wrote:
Guess we should add a test and use six.with_metaclass then. I wonder if
we even need that metaclass, we can set the name by hand in
__new__/__init__ of the class?!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#202 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABOv-lrmCVmhOmBbsVRFiWr2QBKXCUk7ks5rUerZgaJpZM4Lp1D1>
.
|
seems to be the case according to the tests, I'll remove it for now. |
apollo13
added a commit
that referenced
this issue
Jan 21, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently EventType looks like this:
I couldn't find any code setting something in the
__cache__
-- should we just delete it or actually try using it?The text was updated successfully, but these errors were encountered: