ansible --inventory option with a trailing comma

Man pages for ansible and ansible-playbook define -i option as:

`

-i PATH, --inventory=PATH
The PATH to the inventory hosts file, which defaults to
/etc/ansible/hosts.

`

Yet to run on a local system the following syntax is used in examples:

`
ansible -i “localhost,” -c local -m ping localhost

`

What exactly is this "localhost," with a comma at the end (otherwise it is treated as filename)? How does it relate to PATH?

Well… According to this post it is a hack.

Still information is scarce. Is it intentional, a quick fix for the purpose of running against single host, or is it a bug, that got utilized this way…

The , indicates its not a path but an 'adhoc list of hosts', this is
missing from the man pages, which are sadly behind the rest of the
docs