Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:10:00+00:00 2026-06-02T21:10:00+00:00

My question is more oriented toward Python, but it may also be about JavaScript

  • 0

My question is more oriented toward Python, but it may also be about JavaScript or other scripting languages.

I usually develop with statically typed languages (Java, C++, ActionScript, …).

I like to use from time to time Python, and I also need to sometimes use JavaScript. These are dynamic typed languages. Nothing wrong with that, but I usually have lots of headaches to understand which parameters are needed in a function or in a method. It happens even if it is my own code with some docstrings! Maybe because the eye has to look somewhere else than in the definition of the function.

Of course, the answer should be in the documentation. But sometimes it is not clear at all, or because of the use of duck typing the documentation may be itself hard to write (“the first parameter is a function which must have a quack() method and a feathers(arg) method where arg is a string”). What I would very like is a kind of argument description inside the language itself (even if it would be optionnal, like in ActionScript).

What are your best practices to unambiguously describe the arguments of a function/method?

What about creating a special decorator (if using Python) which purpose would be to check the type of data when we use it (but as it will be used at runtime and not at writing time, what would be the point anyway)?

Do you think it should not be an issue? That doing more than current docstring would confuse a developer, or that my mind is too static-typing oriented?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:10:01+00:00Added an answer on June 2, 2026 at 9:10 pm

    I don’t know about Javascript, but Python has optional function annotations since version 3, which look like:

    def haul(item: Haulable, *vargs: PackAnimal) -> Distance:
    

    or:

    def compile(source: "something compilable",
                filename: "where the compilable thing comes from",
                mode: "is this a single statement or a suite?"):
    

    see the PEP for more information.

    They are accessible at runtime and may even be used for type checking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked a related question about findbugs, but let's ask a more general question.
I know there is already a question about this but my issue is more
ASP.Net MVC3 is cool and all but I have this question more out of
One more question about most elegant and simple implementation of element combinations in F#.
This question is more about guidance than actually solving my problem: I need to
This question is more a re-insurance than one directly about how to code. As
This is more of a pattern oriented question as opposed to a language-specific one.
This is more of a business-oriented programming question that I can't seem to figure
This is not really language-specific, but I'll use Python to explain my question. My
This is a question more about best practices/design patterns than regexps. In short I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.