ok, to answer both questions. so, normally, I would db().select() and of course Rows containing Row would return and pass to computations using that data. but there were times when I generated Rows of Row on-the-fly and temporarily and pass that off to the same computational side. so the latter is where I would use this on-the-fly Rows of Row to mimic that it came from the db and I wouldn't have to change the computational side. it's a practical use, believe me.
and so I created a shell script side to test and this is that code:
BOF...
#!/usr/bin/env python
#coding: utf-8
#> xattr -d com.apple.quarantine pydal_row_rows.py
from pydal.objects import Row, Rows
print('opening words.. .')
words = [('the', 26380), ('and', 20367), ('of', 18240), ('to', 15560), ('in', 10501), ('you', 8890), ('a', 7734), ('for', 7691), ('he', 7152), ('lord', 7075), ('i', 6173), ]
print('opened.')
r = Row({'word':words[0][0], 'N':words[0][1]})
print(type(r), r)
print(r.word, r.N, r['word'], r['N'])
# print()
# print('looped.. .')
# qWords1 = Rows()
# for w in words:
# qWords1.append(Row({'word':w[0], 'N':w[1]}))
# print(type(qWords1), len(qWords1))
# for i, w in enumerate(qWords1):
# print(i, w.word, w.N, w['word'], w['N'])
# print('done.')
print()
print('comprehension.. .')
qWords2 = Rows([ Row({'word':w[0], 'N':w[1]}) for w in words ])
print(type(qWords2), len(qWords2))
for i, w in enumerate(qWords2):
print(i, w.word, w.N, w['word'], w['N'])
print('done.')
exit()
EOF.
the most interesting this is that Row seems to work fine in all 3 scenarios. "comprehension" only works when the "looped" section is uncommented. definite weird bug in there somewhere.
ok, thank you in advance and sorry for the delay in responding. Lucas