Posts
Custom PCIe 5.0 SSD with 3D XL-Flash debuts — special Optane-like flash memory delivers up to 3.5 million random IOPS
https://www.tomshardware.com/pc-components/ssds/custom-pcie-5-0-ssd-with-3d-xl-flash-debuts-special-optane-like-flash-memory-delivers-up-to-3-5-million-random-iopsOpen linkView original on programming.devFind the bug (a classic)
class Node:
def __init__(self, edges = set()):
self.edges = edges
def main():
foo = Node()
bar = Node()
quz = Node()
foo.edges.add(bar)
bar.edges.add(foo)
assert(foo is not bar) # assertion succeeds
assert(foo is not quz) # assertion succeeds
assert(bar is not quz) # assertion succeeds
assert(len(quz.edges) == 0) # assertion fails??
main()
::: spoiler spoiler Mutable default values are shared across objects. The set in this case. :::