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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:48:57+00:00 2026-05-22T19:48:57+00:00

Greetings SO, I have a weird problem that I don’t seem to be able

  • 0

Greetings SO,

I have a weird problem that I don’t seem to be able to solve:

I am working with the pydev plugin with eclipse Helios on Windows XP (if it matters).

I have a module which contains a class. The __init__ of this class takes a parameter which determines the set of attributes that a method of this class should have.

Since I am not allowed to show actual code, I can give the following analogy:

class Car:
    def __init__(self, attrs):
        # attrs is a dictionary.
        # the keys of attrs are the names of attributes that this car should have
        # for example, a key of attr could be 'tires'

        # the values of attrs are the values of the attributes which are the keys
        # so if the key is 'tires', it's value might be 4

Now, since I’m setting these variables dynamically at runtime, Pydev is not able to give me suggestions when I do this:

c = Car()
print c.tires

When I type in “c.” +, pydev does not offer tires as a suggestion.

How might I go about getting this functionality? Or is it just not something that pydev can do at present?

I’d appreciate any help

  • 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-22T19:48:57+00:00Added an answer on May 22, 2026 at 7:48 pm

    +1 to Imran for his solution. But, Ia better solution occurred to me:

    Create all attributes in `__init__`.
    When it comes time to be dynamic, delete the unwanted attributes.
    

    This way, ene though the superset of all attributes is still suggested in the autocomplete, memory is not wasted.

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

Sidebar

Related Questions

greetings all i have a problem that when sending an email from the server
Greetings: I have put together a RESTful web service in .NET 3.5 that takes
Greetings! I have an XML value that I'd like to use as a boolean
Greetings, Apologies in advance that I have not researched this toughly enough to answer
Greetings, I'm working on a game project that uses a 3D variant of hexagonal
I have a weird problem and I find no answer on google... I dynamically
Greetings I have a program that creates multiples instances of a class, runs the
i have created a music greetings application in iphone. I want that when a
Greetings. I have a problem with Remember Me possibility. It didn't remember my login.
Greetings! I have an issue here that i can't find. I am getting a

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.