infinispan / infinispan/python-client

Cache should have dictionary-like syntactic sugar

オープン
#1 コメント 0 件 リアクション 0 件 担当者 1 名 @galderz が担当を希望しています GitHub で見る
主要言語
C++
スター
17
フォーク
12
PR マージ指標
30日以内にマージされた PR はありません

説明

The Cache class uses Java Map-style put(), get(), remove() and contains(). Which is fine, but we should also offer Python-style syntactic sugar, so that we can do:

```
cache['key'] = 'value'
print cache['key']
if 'key' in cache:
print 'Key exists!'
for e in cache:
print e
```

etc. Have a look at the implementation of a Python map for more details, or one of the many custom map-like classes available for Python.

This is usually implemented by defining internal methods, such as:

```
def __getitem__(self, key):
return self.get(key)

def __setitem__(self, key, value):
self.put(key, value)
```

etc.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。