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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:15:27+00:00 2026-06-03T15:15:27+00:00

okay, I thought such code could not get wrong, but it obviously does: somewhere:

  • 0

okay, I thought such code could not get wrong, but it obviously does:

somewhere:
    # p is a float value between 0 and 1
    m.limit=PidRange(p-1.0, p+1.0)

class PidRange(Range):
    def __init__(self, low, up):
        Range.__init__(low,up,...)
        pass
    # some methods definition for the PidRange sub-class

class Range(object):
    def __init__(self, p_min=None, p_max=None, ...):
        if (p_min > p_max):
             raise ValueError("Range can't be created: the low bound %f exceeds high bound %f."%(p_min,p_max))

I’m just trying to initialise a [min,max] range with some class hierarchy. But for some totally odd reason, p=0.888337 will
raise the following exception:

    File "src/__main__.py", line 155, in __find_data
        m.limit=PidRange(p-1.0, p+1.0)
    File "src/routing.py", line 32, in __init__
       Range.__init__(low, up, low!=None, up!=None)
    File "src/equation.py", line 30, in __init__
       raise ValueError("Range can't be created: the low bound %f exceeds high bound %f."%(p_min,p_max))
    ValueError: Range can't be created: the low bound 1.888337 exceeds high bound 1.000000.

Has anybody any clue about what’s happening ? I have to admit I’m far from mastering the Python language, but I fail to see any subtlety that could explain such an odd behaviour.

  • 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-03T15:15:28+00:00Added an answer on June 3, 2026 at 3:15 pm

    ah. Figured out.

    • missing a self in __init__ call to the superclass
    • 1.000 ‘extra value’ is a True from the … trans-typed to float

    so superclass constructor invocation ‘breaks’ the call model and require explicit self reference, huh ?

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

Sidebar

Related Questions

Okay I thought this is going to be a piece of cake, but obviously
Okay at first I thought this would be pretty straightforward. But I can't think
Okay so I'm kind of new with OpenGL, but I thought I should learn
Okay, I thought I would be able to do this no problem, but for
Okay, I thought my head hurt with regular regex, but I can't seem to
Okay, thus may seen kind of odd, but I wanted to get some suggestions
Hello kind computing people, Okay this is super broad, but I thought I'd give
Okay, so this probably sounds terribly nefarious, but I need such capabilities for my
Okay, so I know I might get reamed for even suggesting such a thing,
Okay, this may be a dumb question, but I've not been able to find

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.