-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print() of empty array using format string does not work #101401
Comments
I'd say this is to be expected, you need an array of one element and providing one with zero, it should be: var test1 : Array
print('output test1: %s' % [test1])
print('Expected output: []')
print('Debugger Message: ... _ready(): String formatting error: not enough arguments for format string. ...')
print()
var test2 : Array = []
print('output test2: %s' % [test2])
print('Expected output: []')
print('Debugger Message: ... _ready(): String formatting error: not enough arguments for format string. ...')
print()
var test3 : Array [int] = []
print('output test3: %s' % [test3])
print('Expected output: []')
print('Debugger Message: ... _ready(): String formatting error: not enough arguments for format string. ...') |
But why does it work with a dictionary? |
Because |
But Dictionary worked with % (see test4 in my example). |
Yes as I said, it just treats print("User {id} is {name}.".format({"id": 42, "name": "Godot"})) |
Tested versions
Godot Engine v4.4.dev7.official.46c8f8c5c
System information
Godot v4.4.dev7 - Windows 10 (build 19045)
Issue description
the print of an empty array with a format string does not work like expected.
the print of an empty dictionary with a format string works but has 2 spaces between the brackets.
Steps to reproduce
Minimal reproduction project (MRP)
see steps to reproduce
The text was updated successfully, but these errors were encountered: