当一行代码太长时,如何不使用\

员建新*_*员建新 -1 python pep8 python-2.7 python-3.x

我创建了一些类,但是这些类的名称过长(eq:)NegativeChannelMetalOxideSemiconductorFieldEffectTransistor。我想用\python 换行,但是在这种情况下很难看。通常,在Python中,当代码太长时,使用\来换行是一个不错的选择,但在这里行不通。我应该如何缩短或拆分这些行?

图1

图3

Ste*_*uch 5

有关缩短不带以下内容的行的一些建议\

class NegativeChannelMetalOxideSemiconductorFieldEffectTransistor(MetalOxideSemiconductorFieldEffectTransistor):
Run Code Online (Sandbox Code Playgroud)

你可以打破括号的线内[]{}()不使用\

class NegativeChannelMetalOxideSemiconductorFieldEffectTransistor(
    MetalOxideSemiconductorFieldEffectTransistor):
Run Code Online (Sandbox Code Playgroud)

您可以使用首字母缩写词或缩写:

class NegativeChannelMetalOxideSemiconductorFET(MetalOxideSemiconductorFET):
Run Code Online (Sandbox Code Playgroud)

要么:

class NegativeChannelMOSFET(MOSFET):
Run Code Online (Sandbox Code Playgroud)