-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Useless __initialized__ stuff #55
Comments
Dear Pepe, you can suggest all you want, I am learning Python. You are touched the most cumbersome part of the code. FoBiS has been refactored at least two times just because this part was very unclear. As you guess, the As you suggest, I have to re-design this class and its usage. Surely, your help is very appreciated. Let's start...
How I can obtain such goals with a Pythonic programing? Maybe exploting the Thank you Pepe, see you later! |
A new Pepe snippet: class FoBiSConfig(object):
"""
Object handling FoBiS.py configuration
"""
def __init__(self, fake_args=None):
self.__cliparser = cliparser(fake_args)
@property
def cli(self):
return self.__cliparser
@cli.setter
def cli(self, fake_args=None):
self.__cliparser = cliparser(fake_args) MeaningA configurator should do nothing else that stores configurations... it is very cumbersome that FoBiS configurator actually contains the main working procedures. SuggestionRefactor the config in order to be a real config. Pay attention to the private variables ( Exploit the suggested decorators for doing Pythonic usage of private variables. NoteUsing |
Done in current version. |
It is a little bit strange how FoBiS is initialized, resulting in an unnecessary obfuscation...
In fobis.py:7, you are importing the configuration module (which is actually FoBiS itself, or at least the main engine) with a strange command:
It is used just when you are trying to generate a private subclass, but I can't see the point here. Anyway... This command is executing the code in config.py:642:
Which, as far as I can see, is trying to avoid calling FoBiSConfig creation more than once. I should mention right here that just init() has been defined in the class, no new(). Then program is coming back to fobis.py:14:
In the very first line of the function the following is executed (config.py:612):
Which are just calling:
So, an initializated variable was created to avoid calling init() more than once (because no other things are done during the FoBiSConfig class creation), but the first thing we are doing later is manually calling init() again.
May I suggest to redesign it?
The text was updated successfully, but these errors were encountered: