我尝试做的:在.NET平台的泛型集合的基础上,实现泛化数据结构import ssl
logging.basicConfig(level=logging.DEBUG)
credentials = pika.PlainCredentials('*******', '**********')
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
parameters = pika.ConnectionParameters(host='a-25c34e4d-a3eb-32de-abfg-l95d931afc72f.mq.us-west-1.amazonaws.com',
port=5671,
virtual_host='/',
credentials=credentials,
ssl_options=pika.SSLOptions(context)
)
connection = pika.BlockingConnection(parameters)
,其中:
Table<R, C, V>
- 行键
R
- 列键
C
- 价值
该数据结构必须提供对存储在键 V
和 R
上的值的访问,复杂度为 O(1)。
通过创建 C
集合对象演示如何使用此数据结构。
Table<FootballTeam, Tournament, HashSet<int>>
FootballTeam(title, city, foundationYear)
Tournament (title, international: boolean, foundationYear)
- 包含给定 HashSet<int>
赢得 FootballTeam
的年份。
也给出一些你自己使用这个数据结构的例子
我不知道接下来该怎么做,如果我做得对,我想在字典中创建一个字典。
我的代码:
Tournament