Skip to content

Commit

Permalink
Give credits to the internet for the dual static-nonstatic function
Browse files Browse the repository at this point in the history
  • Loading branch information
benallard committed Sep 21, 2011
1 parent 4c500d3 commit 6c415cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pythoncardx/framework/tlv/bertag.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
from pythoncardx.framework.tlv import TLVException

class toBytes(object):
""" This make the toBytes function both static and not static
credits goes there (in decreasing order of importance).
http:https://users.rcn.com/python/download/Descriptor.htm
and there:
http:https://stackoverflow.com/questions/114214/class-method-differences-in-python-bound-unbound-and-static/114289#114289
and here:
http:https://code.activestate.com/recipes/52304-static-methods-aka-class-methods-in-python/
"""
def __get__(self, obj, objtype=None):
if obj is not None:
return obj._toBytesBound
Expand Down

0 comments on commit 6c415cf

Please sign in to comment.