welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::rods::python::pep8 Struct Reference

PEP 8 naming: CapWords (PascalCase) for classes and enum types, snake_case for everything callable or data — methods, static methods, free functions, data members (properties), namespace variables — and submodules. More...

#include <welder/rods/python/naming.hpp>

Inheritance diagram for welder::rods::python::pep8:

Static Public Member Functions

static consteval std::string transform_class (std::meta::info e)
 Classes → CapWords.
static consteval std::string transform_enum (std::meta::info e)
 Enum types → CapWords.
static consteval std::string transform_enumerator (std::meta::info e)
 Enum members → verbatim (see the class note).
Static Public Member Functions inherited from welder::naming::uniform< case_kind::snake >
static consteval std::string transform_class (std::meta::info e)
static consteval std::string transform_enum (std::meta::info e)
static consteval std::string transform_enumerator (std::meta::info e)
static consteval std::string transform_method (std::meta::info e)
static consteval std::string transform_static_method (std::meta::info e)
static consteval std::string transform_function (std::meta::info e)
static consteval std::string transform_field (std::meta::info e)
static consteval std::string transform_variable (std::meta::info e)
static consteval std::string transform_submodule (std::meta::info e)

Detailed Description

PEP 8 naming: CapWords (PascalCase) for classes and enum types, snake_case for everything callable or data — methods, static methods, free functions, data members (properties), namespace variables — and submodules.

Built by inheriting the all-snake_case base and overriding the two kinds PEP 8 spells differently (types → CapWords) plus enum members, which are kept verbatim: C++ enumerators are already authored in the constant style the writer intends (Red, MAX, …), and Python's enum imposes no case, so reshaping them would be a surprising, lossy rename rather than a convention fix. (Whichever way an enumerator is spelled, int(E.Value) still works — the pybind11/nanobind rods bind enum.IntEnum.)

Note
"CapWords" here normalizes acronyms — HTTPServerHttpServer — since the words are lower-cased before re-capitalization. Idiomatic C++ class names are already PascalCase and pass through unchanged; reach for [[=welder::weld_as]] to pin an exact spelling. Satisfies welder::naming::name_style.

Definition at line 45 of file naming.hpp.

Member Function Documentation

◆ transform_class()

consteval std::string welder::rods::python::pep8::transform_class ( std::meta::info e)
inlinestaticconsteval

Classes → CapWords.

Definition at line 47 of file naming.hpp.

References welder::naming::pascal.

◆ transform_enum()

consteval std::string welder::rods::python::pep8::transform_enum ( std::meta::info e)
inlinestaticconsteval

Enum types → CapWords.

Definition at line 52 of file naming.hpp.

References welder::naming::pascal.

◆ transform_enumerator()

consteval std::string welder::rods::python::pep8::transform_enumerator ( std::meta::info e)
inlinestaticconsteval

Enum members → verbatim (see the class note).

Definition at line 57 of file naming.hpp.


The documentation for this struct was generated from the following file: