Simple question of Python? class 'BMFace', how get the value 'totverts'?

This should be a basic question of python. A BMface displays the following information:

<BMFace(0x000000A56ABF4A08), index=17, totverts=4>

How do can I get the value ‘totverts’?

I know I can use the command len(BMface.verts), but why do so if the information is already given automatically? Somehow.

Only because repr() prints “totverts=…” doesn’t mean that there’s ever an attribute totverts, and even if there is, it doesn’t mean it’s necessarily exposed to Python.

len(face.verts) is still your best option in Python.

repr(bm.faces[0]).rsplit("=", 1)[-1][:-1] is probably less efficient.

Okay. Good to know. Thanks again @CoDEmanX :slight_smile: