Retrieve bins edges when creating histogram

Is it possible to get bins edges using Python API like matplotlib does? For example

import matplotlib.pyplot as plt

valuelist = [2, 5, 10, 3, 12,...]
(n, bins, values) = plt.hist(valueslist, nbins)