def prop_is(type, property, value): """Returns true if the specified object property is of the given type; false otherwise""" return is_(type, prop(property, value))
def test_prop_nocurry_property(): assert_equal(prop("val")({"val": "foo"}), "foo")
def get_hrefs(self): return f.reduce(lambda acc, x: {**acc, x[0]: r.cond([[r.pipe(type, r.equals(dict)), r.prop("href")], [r.pipe(type, r.equals(list)), r.map(r.prop('href'))]], x[1])}, r.to_pairs(self.links), {})
def test_prop_curry(): assert_equal(prop("val")(test_object), "foo")