1# Properties are case-insensitive, but this can lead to some
2# surprising behavior: the first way a property is used will
3# determine how it ends up in the global symbol table.
4#
5# Sample output:
6#   Property('S', 'HeLLo') Property('S', 'HeLLo')
7#   2
8#   2
9#   135099576
10#   135033272
11#   0
12
13import metakit
14db = metakit.storage()
15v1 = db.getas('lo[HeLLo:S]')
16v2 = db.getas('hi[hello:S]')
17
18# surprise: this prints two mixed-case names
19print v1.HeLLo, v2.hello
20
21# this shows that the Metakit property is the same for both
22# reason: there is a single global case-insensitive symbol table
23print metakit.property('S','HeLLo').id
24print metakit.property('S','hello').id
25
26# this shows that the Python objects differ
27# reason: these are two wrapper objects around the same thing
28print id(metakit.property('S','HeLLo'))
29print id(metakit.property('S','hello'))
30
31# this causes a mismatch, it will have to be fixed one day
32print metakit.property('S','HeLLo') == metakit.property('S','hello')
33