Python の dict は None もキーになる
code:python
>> {None: 'test'}
{None: 'test'}
知らなかった…
確かにクラスオブジェクトとかは入るし、Noneも可能性としては入ってもおかしくなかったけれど…
The key of the dictionary is the name of the blueprint this function is active for, None for all requests.
Flaskのドキュメント読んでて発見
Pythonリファレンス
int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)(原文)
辞書 p に、 key をキーとして値 value を挿入します。 key はハッシュ可能(hashable)でなければなりません; ハッシュ可能でない場合、 TypeError を送出します。成功した場合には 0 を、失敗した場合には -1 を返します。
なるほど
JSON
code:python
>> json.dumps({None: 'test'})
'{"null": "test"}'
>> json.loads('{"null": "test"}')
{u'null': u'test'}
JSONは null をキーに出来ないので、もとに戻らない