m = bson.Mapper() assert not m.python_only
Jump to turn (18)
- 1m = bson.Mapper() assert not m.pythononly
- 2На русском
- 3Атрибут это что,
- 4Не хотелось бы фиксировать в API класса список парамеров конфигурации. Пусть кон
- 5А что делает argc
- 6m = Mapper() m.pythononly = True # порождает AttributeError как сделать
- 7Я хочу, чтобы он был неизменяемся
- 8class Mapper: def init(self, kwargs): self.pythononly = False if 'pythononly' in
- 9Более того, нам вовсе НЕ нужно убирать из API модуля функции. Их логика должна п
- 10m = Mapper(something=True) # порождает MapperConfigError что это значит и как эт
- 11Method 'marshal' may be 'static'
- 12Traceback (most recent call last): File "/Users/nikuradzedima/PycharmProjects/py
- 13result = bson.unmarshal(bson.Mapper().marshal(inp)) мне надо чтобы я мог вот так
- 14Более того, нам вовсе НЕ нужно убирать из API модуля функции что значит эта фраз
- 15bson.unmarshal(bson.Mapper().marshal(inp)) вот так тоже надо уметь вызывать
- 16Все должно быть методами класса
- 17result = bson.Mapper().unmarshal(bson.marshal(inp)) и так тоже надо
- 18result = bson.Mapper().unmarshal(bson.marshal(inp)) result = bson.unmarshal(bson
- User
m = bson.Mapper()
codeassert not m.python_only - Assistant
It looks like you're working with BSON (Binary JSON) in Python and using a mapper class. The line of code you've posted suggests that you want to assert that the
python_onlyattribute of theMapperobject (m) is set toFalse.Here's a breakdown of what the code does:
-
m = bson.Mapper(): This line initializes an instance of the class from the BSON library.
-