mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 23:36:30 +01:00
Some optimizations, cleanup and a few bugfixes. Just changing a spurious property retrieval in the typeclass removed an extra, pointless database query.
This commit is contained in:
parent
160d4a2807
commit
0dae03156c
5 changed files with 57 additions and 38 deletions
|
|
@ -34,7 +34,13 @@ def is_iter(iterable):
|
|||
they are actually iterable), since string iterations
|
||||
are usually not what we want to do with a string.
|
||||
"""
|
||||
return hasattr(iterable, '__iter__')
|
||||
# use a try..except here to avoid a property
|
||||
# lookup when using this from a typeclassed entity
|
||||
try:
|
||||
_GA(iterable, '__iter__')
|
||||
return True
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
def make_iter(obj):
|
||||
"Makes sure that the object is always iterable."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue