Skip to content

Not sure what the bug was. Might be me importing a custom function, but it still crashed when I defined it at the top #3387

@Shadow2008

Description

@Shadow2008

Black v22.10.0

Playground link

Options

--line-length=88
--safe

Input

from turtle import *
from betterInput import getInt

speed(0)
betweenBounds == False
numPoints = getInt("Enter an odd number: ", odd=True)
numPointsSkip = 1
int(numPoints/4) = smallNum
while numPoints % numPointsSkip == 0 and not betweenBounds:
    numPointsSkip = getInt(
        f"Enter a number. It may not divide the number\
of points in the star, and must be between \
{smallNum} and {smallNum*3}: "
    )
    if numPointsSkip >= smallNum and numPointsSkip <= smallNum * 3:
        betweenBounds = True
    
xCors = []
yCors = []

pu()
goto(0, -50)
pd()

for i in range(numPoints):
    circle(100, 360 / numPoints)
    xCors.append(xcor())
    yCors.append(ycor())
pointToGo = 0
pos = pointToGo % numPoints
pu()
goto(xCors[pos], yCors[pos])
pd()
for i in range(numPoints + 1):
    pos = pointToGo % numPoints
    goto(xCors[pos], yCors[pos])
    pointToGo += numPointsSkip

Output

cannot use --safe with this file; failed to parse source file AST: cannot assign to function call (<unknown>, line 8)
This could be caused by running Black with an older Python version that does not support new syntax used in your source file.

Expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions