Attribute 'interaction' defined outside __init__
207 async def start(self, interaction: nextcord.Interaction):
208 self.author = interaction.user
209 self.channel = interaction.channel
210 self.interaction = interaction
Attribute 'channel' defined outside __init__
206
207 async def start(self, interaction: nextcord.Interaction):
208 self.author = interaction.user
209 self.channel = interaction.channel210 self.interaction = interaction
Attribute 'author' defined outside __init__
205 )
206
207 async def start(self, interaction: nextcord.Interaction):
208 self.author = interaction.user209 self.channel = interaction.channel
210 self.interaction = interaction
Attribute 'interaction' defined outside __init__
165 """
166 self.author = interaction.user
167 self.channel = interaction.channel
168 self.interaction = interaction169 dropdown = DropdownSelector(
170 options=self.options,
171 placeholder=self.placeholder,
Attribute 'channel' defined outside __init__
164 interaction (nextcord.Interaction): The interaction that triggered the view.
165 """
166 self.author = interaction.user
167 self.channel = interaction.channel168 self.interaction = interaction
169 dropdown = DropdownSelector(
170 options=self.options,
Attribute 'author' defined outside __init__
163 Args:
164 interaction (nextcord.Interaction): The interaction that triggered the view.
165 """
166 self.author = interaction.user167 self.channel = interaction.channel
168 self.interaction = interaction
169 dropdown = DropdownSelector(
Description
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.