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 258055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:08:55+00:00 2026-05-11T22:08:55+00:00

My background is C and C++. I like Python a lot, but there’s one

  • 0

My background is C and C++. I like Python a lot, but there’s one aspect of it (and other interpreted languages I guess) that is really hard to work with when you’re used to compiled languages.

When I’ve written something in Python and come to the point where I can run it, there’s still no guarantee that no language-specific errors remain. For me that means that I can’t rely solely on my runtime defense (rigorous testing of input, asserts etc.) to avoid crashes, because in 6 months when some otherwise nice code finally gets run, it might crack due to some stupid typo.

Clearly a system should be tested enough to make sure all code has been run, but most of the time I use Python for in-house scripts and small tools, which ofcourse never gets the QA attention they need. Also, some code is so simple that (if your background is C/C++) you know it will work fine as long as it compiles (e.g. getter-methods inside classes, usually a simple return of a member variable).

So, my question is the obvious – is there any way (with a special tool or something) I can make sure all the code in my Python script will “compile” and run?

  • 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-05-11T22:08:55+00:00Added an answer on May 11, 2026 at 10:08 pm

    Look at PyChecker and PyLint.

    Here’s example output from pylint, resulting from the trivial program:

    print a
    

    As you can see, it detects the undefined variable, which py_compile won’t (deliberately).

    in foo.py:
    
    ************* Module foo
    C:  1: Black listed name "foo"
    C:  1: Missing docstring
    E:  1: Undefined variable 'a'
    
    
    ...
    
    |error      |1      |1        |=          |
    

    Trivial example of why tests aren’t good enough, even if they cover “every line”:

    bar = "Foo"
    foo = "Bar"
    def baz(X):
        return bar if X else fo0
    
    print baz(input("True or False: "))
    

    EDIT: PyChecker handles the ternary for me:

    Processing ternary...
    True or False: True
    Foo
    
    Warnings...
    
    ternary.py:6: No global (fo0) found
    ternary.py:8: Using input() is a security problem, consider using raw_input()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 121k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First of all, rubygems will load the highest version number… May 12, 2026 at 12:35 am
  • Editorial Team
    Editorial Team added an answer Number of fields and their names could be acquired as… May 12, 2026 at 12:35 am
  • Editorial Team
    Editorial Team added an answer ddddddddddddddddddddddddddddddddddddddddddddddddddddddd is > 181px. Its obviously going to overflow because… May 12, 2026 at 12:35 am

Related Questions

My background is C and C++. I like Python a lot, but there's one
First things first, I am a Python beginner, with a typical C++/Java background for
I'm looking for an Objective-C way of sorting characters in a string, as per
I have a limited c++ background and I would like to edit the registry.
I've been learning Objective-C and Cocoa by working my way through the Hillegass book

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.