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

Refs #29299 -- Add type annotations to gettext. #12544

Closed
wants to merge 1 commit into from

Conversation

PetterS
Copy link
Contributor

@PetterS PetterS commented Mar 9, 2020

Can add more of these if patches like these are welcome. They would help our project, if present.

@@ -88,7 +88,7 @@ def ugettext_noop(message):
return gettext_noop(message)


def gettext(message):
def gettext(message: str) -> str:
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is accurate. The underlying gettext() function for when translations are active doesn't seem to make guarantees about type, and uses mark_safe in the case of messages that are already SafeData:

def gettext(message):

@felixxm
Copy link
Member

felixxm commented Mar 9, 2020

DEP 65 is still on a draft stage so we don't accept type annotations for now.

@felixxm felixxm closed this Mar 9, 2020
@PetterS
Copy link
Contributor Author

PetterS commented Mar 9, 2020

Ok thanks Mariusz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants