diff --git a/bob/io/base/hdf5.cpp b/bob/io/base/hdf5.cpp
index d909e544b2433c30bd1d7520029ecec983fcf5b7..ad8a823b487ceeb4d3d660ef66fb8444679daedb 100644
--- a/bob/io/base/hdf5.cpp
+++ b/bob/io/base/hdf5.cpp
@@ -301,7 +301,8 @@ static auto s_has_dataset = bob::extension::FunctionDoc(
   "Checks if a dataset exists inside a file",
   "Checks if a dataset exists inside a file, on the specified path. "
   "If the given path is relative, it is take w.r.t. to the current working directory.\n\n"
-  ".. note:: The functions :py:meth:`has_dataset` and :py:meth:`has_key` are synonyms.",
+  ".. note:: The functions :py:meth:`has_dataset` and :py:meth:`has_key` are synonyms. "
+  "You can also use the Python's ``in`` operator instead of :py:meth:`has_key`: ``key in hdf5file``.",
   true
 )
 .add_prototype("key")
diff --git a/bob/io/base/test_hdf5.py b/bob/io/base/test_hdf5.py
index 67515049b27ac965d3b56d84d7f81050e0022fae..0c12f2b7407be074af4df9efaaf1bfa325fce235 100644
--- a/bob/io/base/test_hdf5.py
+++ b/bob/io/base/test_hdf5.py
@@ -477,6 +477,7 @@ def test_copy_constructor():
 
     assert shallow.has_group("/Test")
     assert shallow.has_key("/Test/Data")
+    assert "/Test/Data" in shallow
     assert hdf5.filename == shallow.filename
     assert hdf5.keys() == shallow.keys()
     assert hdf5.cwd == shallow.cwd