Перед тем как передать store
в get
, пройдите через toJS
утилиту по mobx. Это должно решить это.
так что ваш один вкладыш будет - _.get(toJS(store), "prop.arr[0].subProp")
больше на toJS
здесь - https://mobx.js.org/refguide/tojson.html
The strip() method of strings removes whitespace from both ends.
set(line.strip() for line in open('filename.txt'))
Just load all file data and split it, it will take care of one word per line or multiple words per line separated by spaces, also it will be faster to load whole file at once unless your file is in GBs
words = set(open('filename.txt').read().split())
To remove only the right hand spaces.
set(map(str.rstrip, open('filename.txt')))
with open("filename.txt") as f:
mySet = map(str.rstrip, f)
Если вы хотите использовать это в Python 2.5, вам нужен
from __future__ import with_statement
with open("filename.txt") as f:
s = set([line.rstrip('\n') for line in f])