class name should be CamelCase

이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

Metadata

ID: python-code-style/class-name

Language: Python

Severity: Notice

Category: Code Style

Description

Class names should be CamelCase and not camelCase or snake_case.

Learn More

Non-Compliant Code Examples

class _runtimeMetricsStatus(type):
    pass
class myClass(Parent):
    def __init__(self):
        pass

Compliant Code Examples

class REQUESTS_MODE(IntEnum):
    AGENTLESS_EVENTS = 0
    EVP_PROXY_EVENTS = 1
class _RuntimeMetricsStatus(type):
    pass
class Migration(migrations.Migration):

    dependencies = [
        ('tweets', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='tweet',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='tweets.tweet'),
        ),
        migrations.DeleteModel(
            name='Reply',
        ),
    ]
class MyClass(Parent):
    def __init__(self):
        pass

class TestRestapiV4Lock(FunctionalTestController):
    pass

class TestS3Storage(TestCase):
    pass

class TestS35Storage(TestCase):
    pass

class TestS35Storage(TestCase):
    pass

class Float64Serializer(object):
    pass

class LongNameThatHa5SomeNumbers999:
    pass

class K8sFaultyChangeSignal:
    pass

class ModeA:
    pass

class CreateAMode:
    pass
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis

PREVIEWING: may/unit-testing