This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.db import models, migrations | |
class Migration(migrations.Migration): | |
dependencies = [ | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class X: | |
@staticmethod | |
def y(self): | |
return 3 | |
z = [y] | |
>>> X.y | |
<function X.y at 0x7fc5e5ca90d0> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
from django.core import validators | |
from django.db import models, migrations | |
from django.utils import timezone | |
class Migration(migrations.Migration): | |
dependencies = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass(object): | |
def a(self): | |
pass | |
b = [a] | |
# Get the reference to a from the list | |
a = MyClass.b[0] | |
# How do I get the class a was defined on? Is it even possible? | |
# On Python 3, I can use __qualname__. This isn't around on Python 2. |
NewerOlder