jceb / vim-orgmode

Text outlining and task management for Vim based on Emacs' Org-Mode
http://www.vim.org/scripts/script.php?script_id=3642
Other
3.12k stars 266 forks source link

[RFC] Some refactoring #237

Closed akstrfn closed 8 years ago

akstrfn commented 8 years ago

Is is not planned to change the behaviour nor modify the architecture. Some planned stuff, let me know what you think.

Ron89 commented 8 years ago

Thanks for the work improving memory efficiency and in reducing the code redundancy. Regarding to your TODO Shouldn't there be and error when values is not int?, is there scenarios when level can be not int?

And, though I do understand the name Exception might be too broad... Why BaseException?

PS. From the look of it, I think we should wait before you finishing the refactoring before pulling in?

akstrfn commented 8 years ago

Hi @Ron89, I don't think that there are any scenarios when _level shouldn't be int but it never will be because the getter will return integer. The thing is this allows for use of something like this something.level = '01' which makes the things implicit and that can lead to errors. I didn't want to change the behaviour of this for now.

As for Exceptions, I guessed that current code was trying to catch any exception hence before all exceptions were derived from Exception but now that is not the case, hence I changed it to BaseException

I am still working on it so don't pull it yet. I had quite a bit of problems with __*slice__ methods because of the way python 2 uses them.

akstrfn commented 8 years ago

It seems that this refactoring has broken the alignment, luckily I tested it because of PR #239 fixed