Skip to content
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

Add Object support for String.format #65962

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

4d49
Copy link
Contributor

@4d49 4d49 commented Sep 17, 2022

This adds Object as argument for formatting strings.

Example:

extends Node2D


func _ready() -> void:
	# Prints: Position: (0, 0); Rotation: 0
	print("Position: {position}; Rotation: {rotation}".format(self))
	
	# Prints: Visible: true; Scale: (1, 1)
	print("Visible: {visible}; Scale: {scale}".format(self))

Closes godotengine/godot-proposals#5434

@4d49 4d49 requested review from a team as code owners September 17, 2022 04:44
@kleonc kleonc added this to the 4.x milestone Sep 17, 2022
@kleonc kleonc added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 17, 2022
@YuriSizov YuriSizov changed the title Format object Add Object support for String.format Sep 17, 2022
@akien-mga akien-mga modified the milestones: 4.x, 4.0 Sep 20, 2022
@akien-mga
Copy link
Member

Looks good! Could you squash the commits? See PR workflow for instructions.

@4d49
Copy link
Contributor Author

4d49 commented Sep 21, 2022

Looks good! Could you squash the commits? See PR workflow for instructions.

Done.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 10, 2023
@YuriSizov
Copy link
Contributor

Seems like we missed this one, sorry. Needs a rebase, and I guess it can then be merged for 4.1.

@YuriSizov YuriSizov modified the milestones: 4.1, 4.2 Jun 14, 2023
@AThousandShips AThousandShips modified the milestones: 4.2, 4.3 Oct 26, 2023
@AThousandShips AThousandShips modified the milestones: 4.3, 4.4 Jul 25, 2024
@Repiteo Repiteo merged commit b8f626a into godotengine:master Oct 30, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 30, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support Object as argument for String.format()
7 participants