add __hash__ to PolicyConstraints and Extension (#3917)

2 files changed