Hey thanks for the response.
It selects the contents of a tag (html, xml) etc.. The challenges and what ended up making it be more robust, is making sure it captures the tag the cursor is actually inside of, and making sure to ignore things like self closing tags.
Given the following:
<p>Some text, with a <a href="/go/somewhere">link</a>.</p>
If the cursor was on the word title and I used the command, it would select 'Title'. If it was on the empty line above the closing head tag, it would select, \n\n\n. If it was on the empty line below the closing head tag, it would select everything inside the html tag.
As you can see for the command to be useful it gets a bit complicated and you can't just have it select everything between the nearest opening and closing tags.
No problem with me if you have any bias, might be good so I can hear the things that are really great about it as I'm new and haven't explored Python that much.
Pythons data structures are driving me nuts because they're all so similar. As far as I can tell the major difference between lists and tuples is that tuples are immutable and lists aren't. The biggest response I've seen for issues with Python is 'well if you're running into that you're doing it wrong'. So I just wonder well, if you need a list to be immutable why just not edit it? Then you have dictionaries, which are basically just lists with named keys. Then you have sets that are unordered tuples. To me they all just seem like arrays with minor differences.
1) If Python had foreach, that'd be awesome. WTB foreach $list as $key => $value ! I think basically what I did was I created that list of tuples manually instead of having enumerate do it.
2) It probably does need a good bit of refactoring, but with my limited knowledge of Python, and since I just got it working, I haven't really come up with anything.
3) I'm pretty sure it's Python. I print the data as I first got it and it's fine, then I print it again after running it through the list comprehension, which is pretty much just tuple() and has nothing to do with the API, and it's changed.
Also I really hate not having to declare variables. Feels so messy. Though I'm loving not having PHP's magical wisdom trying to fiddle with converting between types and the annoyances between loose and strict comparisons because of it.