Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 79256

Python is a dynamically typed, high-level interpreted programming language. Its design focuses on clear syntax, an intuitive approach to object-oriented programming, and making the right way to do things obvious. Python supports modules and exceptions, and has an extensive standard module library. Python is general-purpose and thus used widely, from the web to embedded systems.

1 vote
Accepted

Python function (or set of functions) as input of a function or class

Functions are perfectly normal objects in Python, so the answer is yes. …
RemcoGerlich's user avatar
  • 3,360
1 vote

Why does string.find("") = 0?

When you use string.find(somesubstring) and it returns an index i, not equal to -1, that means that the substring of string starting at index i and having the same length as somesubstring is equal to …
RemcoGerlich's user avatar
  • 3,360
2 votes

Django urls.py runs only once. Why? How does it call views on next request?

Python runs a module when it is imported, and after that it is just kept in memory. Django can access the urlpatterns variable in the module whenever it once, the module isn't re-run. … That's not specific to Django or urls.py, it's just how Python modules work. …
RemcoGerlich's user avatar
  • 3,360
13 votes

Is colon in python blocks technically necesary?

Guido van Rossum (creator of Python) had a Python history blog for a while. The colon was introduced in ABC, the source of many of Python's features. …
RemcoGerlich's user avatar
  • 3,360
2 votes

Why does Python only make a copy of the individual element when iterating a list?

This was the main reason that it look a long time for it to get implemented in Python, as Python developers were afraid it would be confusing. …
RemcoGerlich's user avatar
  • 3,360
4 votes

Does this code follow duck typing?

First, I want to say that by far not everybody agrees that duck typing is a good thing at all, let alone that it is some sort of holy principle that should be followed. Often duck typing leads to erro …
RemcoGerlich's user avatar
  • 3,360
1 vote

Django: caching properties for non-changing entries

Django includes a cached_property utility; it turns your method into a property (can be read as if it were an attribute), but after the first time the method is run, it is replaced by its return value …
RemcoGerlich's user avatar
  • 3,360