mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 00:36:30 +01:00
Added "typeclass" as a shortcut variable name of __getattribute__. This allows for obj.typeclass to always cleanly return typeclass regardless of if obj is already a typeclass or is a database object. I.e. the same functionality of using obj.dbobj to always get the database object.
This commit is contained in:
parent
7ba0683d9d
commit
c0d634fe8c
1 changed files with 2 additions and 0 deletions
|
|
@ -97,6 +97,8 @@ class TypeClass(object):
|
|||
"""
|
||||
if propname == 'dbobj':
|
||||
return _GA(self, 'dbobj')
|
||||
if propname == 'typeclass':
|
||||
return self
|
||||
if propname.startswith('__') and propname.endswith('__'):
|
||||
# python specials are parsed as-is (otherwise things like
|
||||
# isinstance() fail to identify the typeclass)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue