# Examples from pyvista.vtk_snake_case
# ====================================

# Get the current access state for VTK's snake_case api.
import pyvista as pv
pv.vtk_snake_case()

# The following will raise an error because the information property is defined
# by vtkDataObject and is not part of PyVista's API.
# pv.PolyData().information

# Allow use of VTK's snake_case attributes. No warning or error is raised.
_ = pv.vtk_snake_case('allow')
pv.PolyData().information

# Note that this state is global and will persist between function calls. Set it
# back to its original state explicitly.
_ = pv.vtk_snake_case('error')

# Use it as a context manager instead. This way, the state is only temporarily
# modified and is automatically restored.
with pv.vtk_snake_case('allow'):
    _ = pv.PolyData().information

pv.vtk_snake_case()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

