vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.22k stars 766 forks source link

Typing: VirtualMachine optional fields #1074

Open IvarVirusiim opened 6 months ago

IvarVirusiim commented 6 months ago

Describe the bug

Type hints for the VirtualMachine object aren't correct. The following fields should be optional (according to the documentation):

Reproduction steps

Look at VirtualMachine object type hints.

vm: vim.VirtualMachine

... (logic for fetching VM)

config: vim.vm.ConfigInfo | None = vm.config (<- is not 100% correct, because vm.config type hint is just vim.vm.ConfigInfo)

Expected behavior

Type hints are shown as optional for those fields.

Additional context

Documentation