question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove unnecessary field aliases (`Str`, `Int`, `Bool`, etc.)

See original GitHub issue

Marshmallow/Flask-Marshmallow provides some aliases for fields, for example, Str and String. To keep everything simple and consistent, I suggest removing these aliases, so that the IDE will not prompt Url and URL when you type “U” (in that case the users have to make the choice each time).

Proposal:

Remove the following aliases:

  • Str
  • Int
  • Bool
  • Url
  • UrlFor
  • AbsoluteUrlFor

Keep the following:

  • String
  • Integer
  • Boolean
  • URL
  • URLFor
  • AbsoluteURLFor

Originally posted in https://github.com/greyli/apiflask/issues/63

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
9999yearscommented, Jul 12, 2021

There should be one-- and preferably only one --obvious way to do it.

PEP 20

There’s a reason Python doesn’t have string as an alias of str in builtins.

0reactions
9999yearscommented, Jul 12, 2021

Purposefully evading static analysis seems unwise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove all special characters, punctuation and spaces from ...
This will remove all special characters, punctuation, and spaces from a string and only have numbers and letters.
Read more >
typing — Support for type hints — Python 3.11.1 documentation
The function below takes and returns a string and is annotated as follows: ... A type alias is defined by assigning the type...
Read more >
Language Guide (proto3) | Protocol Buffers - Google Developers
One way to make sure this doesn't happen is to specify that the field numbers (and/or names, which can also cause issues for...
Read more >
Model field reference - Django documentation
If True , Django will store empty values as NULL in the database. Default is False . Avoid using null on string-based fields...
Read more >
PythonTA Checks
def __init__(self, names: List[str], values: List[int]) -> None: self. ... This error occurs when a boolean expression contains an unneeded negation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found