Python Forum

Full Version: Empty list literal display error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There seems to be an issue with the literal for an empty list in python tags.

The following in tags should read ">>> open_bracket close_bracket"
but both inline and python tags remove the brackets.
>>>
>>> 
Edit: Okay so it seems the editor itself is eating them. If I type them and post they appear. If I go preview they dissappear from the editing area. If I try to edit a post with them they also disappear.
Known problem. It was the cost of fixing some other editor problem.
So are we trying to fix it or just accepting it as broken?
I think we're accepting it as broken, and watching out for it.
You can look at this page for the discussion.
Quote:Unfortunately this editor does not support empty tag.
you can check in http://sdk.ckeditor.com/samples/bbcode.html that same issue will happen.
So we have not put more effort into fixing it,as our new Rin Editor is based on Ckeditor.
It's a problem that rarely comes up,and when it do we know what it is.
If you want look into the regex for it you are welcome do it,as long as it don't break anything else Wink
I guess its the lesser of two evils. Its the new Rin Editor's (based on Ckeditor) fault. The default MyBB editor was removing whitespaces if previewing before posting. The Ckeditor or any descendants apparently remove empty [] lists.

I contacted the Rin Editor author and he said its Ckeditor issue and that i would have to contact them. Personally i think by the time they fix that and implement it into their release, MyBB 2.0 might be out.

I looked into the CKeditor and the whole thing is just javascript with no whitespace in their pages. Almost unreadable. I made a github issue on there page. But i dont expect anything from it. We could try some things if someone wants to tweak it.
It works as long as you don't ever preview the post or edit the post (write only):
spam = []
Another option is to... not have an empty list (space between brackets):
foo = [ ]
Short of changing editors, I think our only solution is to wait for an upstream patch (...or fix it ourselves, and submit a patch).
Quote:Short of changing editors, I think our only solution is to wait for an upstream patch (...or fix it ourselves, and submit a patch).
I think when mybb 2.0 comes out we will be switching. A lot of the plugins and core edits we use will be implemented into the MyBB Core. I have made them aware of their default MyBB editor issue of removing spaces (Which is why we switched editors in the first place).