I was fixing a makefile the other day with a coworker and it ended up being an indentation issue. And then we asked out loud why anyone would repeat this hell again...
Now, I am not a python programmer, but I am interested to learn more about how the structure via indentation how worked out for the language.
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__
handler.post(*groups)
File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 122, in post
headers={'Content-Type': 'application/x-www-form-urlencoded'}).content)
File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/utils/simplejson/__init__.py", line 232, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/utils/simplejson/decoder.py", line 251, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/utils/simplejson/decoder.py", line 270, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__
handler.post(*groups)
File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 140, in post
synonym = synonym_for_word(stripped_word, tag)
File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 201, in synonym_for_word
return result.get(word_type)['syn'][0]
KeyError: 'syn'
It's an easy mistake to make - when you come from a Java or C# background one of the most striking things about Python and Ruby code is the use of first-class functions.
Not everybody knows that there's more to a functional language than first-class functions.
Completely unrelated to your write up but theres a bug. In FF if I back up and resubmit it doesn't update to the new text. I still see my first submission.
Ah yes, I randomly generate a permalink on load of the page, so it uses the old permalink, hence why it loads the first submission. Any ideas on how to change this?
"App engine is fast and awesome, right now. However, if your site gets really popular, you may consider moving off of it."
Perhaps you can explain why you believe this to be true? I thought that the strength of App Engine is that you can stay on it no matter how popular your app gets.
App engine doesn't allow certain features, like subdomains for each user, and non-www. URLs. Some other things too, that I probably don't even know about yet.
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__
handler.post(*groups)
File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 140, in post
synonym = synonym_for_word(stripped_word, tag)
File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 201, in synonym_for_word
return result.get(word_type)['syn'][0]
KeyError: 'syn'
[+] [-] Luyt|15 years ago|reply
I disagree. Idiomatic Python uses 4 spaces per indent.
Either solely use tabs or solely use spaces, they don’t work well together, at least in my experience
Mixing tabs and spaces is indeed very unwise. You can run Python with the -tt option to make sure you're consistent.
Read Style Guide for Python Code for more advice on this front
I agree ;-) The author probably refers to PEP8, http://www.python.org/dev/peps/pep-0008/
[+] [-] bwooceli|15 years ago|reply
:set tabstop=4
:set shiftwidth=4
:set expandtab
[+] [-] shortlived|15 years ago|reply
Now, I am not a python programmer, but I am interested to learn more about how the structure via indentation how worked out for the language.
[+] [-] sahillavingia|15 years ago|reply
[+] [-] gurraman|15 years ago|reply
[+] [-] sahillavingia|15 years ago|reply
[+] [-] colbyolson|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] olalonde|15 years ago|reply
[1] http://norvig.com/21-days.html
[+] [-] itsnotvalid|15 years ago|reply
Did I see something strange here?
[+] [-] rimantas|15 years ago|reply
[+] [-] josephcooney|15 years ago|reply
[+] [-] moconnor|15 years ago|reply
Not everybody knows that there's more to a functional language than first-class functions.
[+] [-] sahillavingia|15 years ago|reply
[+] [-] torme|15 years ago|reply
[+] [-] sahillavingia|15 years ago|reply
[+] [-] smoody|15 years ago|reply
Perhaps you can explain why you believe this to be true? I thought that the strength of App Engine is that you can stay on it no matter how popular your app gets.
[+] [-] sahillavingia|15 years ago|reply
[+] [-] jscore|15 years ago|reply
[+] [-] StanDarsh|15 years ago|reply
[+] [-] jacquesm|15 years ago|reply
Congratulations!
[+] [-] sahillavingia|15 years ago|reply
[+] [-] paulbaumgart|15 years ago|reply
[+] [-] davidj|15 years ago|reply
[+] [-] dgreensp|15 years ago|reply