Skip to main content

Questions tagged [python]

For questions about Python's design, or languages which are closely related to Python

1 vote
2 answers
334 views

want to design a simple programming language for educational purposes. My goal is to understand the fundamentals of how a language works — defining syntax, grammar, and how code gets executed (...
Anna Cláudia Speck de Souza's user avatar
12 votes
4 answers
5k views

In Python we have the concept of a soft keyword, which makes some keywords reserved only in some special cases (e.g. match, case ...
Amir reza Riahi's user avatar
3 votes
1 answer
395 views

I am confused about the implementation of a global namespace in python . How are variable names mapped as keys to the objects they reference as values ,since namespace is implemented as a dictionary? ...
Silah's user avatar
  • 33
1 vote
2 answers
1k views

It seems that JS's map and Python's dictionary are equivalent. Is that correct? And if so, why they aren't called the same? Given that JS is newer, why wouldn't the map be called as dictionary as well?...
Ooker's user avatar
  • 175
7 votes
2 answers
631 views

I came across this question on Stack Overflow and it got me wondering... why did Python choose to allow single line compound statements? Python has significant whitespace, and it seems like the parser ...
Jared Smith's user avatar
5 votes
3 answers
817 views

How the implementations of JIT in R, Python and Julia differs? Are there characteristics of the language that make the compiler's job harder or less efficient in some language compared to others? On a ...
Antonello's user avatar
  • 151
16 votes
6 answers
11k views

Python does not usually use explicit line-ending characters; the parser can almost always figure out where a statement ends from the positioning of newlines. However, Python's syntax allows you to use ...
Ginger's user avatar
  • 2,707
2 votes
1 answer
602 views

After playing around Python a little bit, I feel like Python does not encourage us to read objects's content. Take JavaScript for example: just a simple act of calling an object will list all the ...
Ooker's user avatar
  • 175
10 votes
1 answer
3k views

When coding in Python, I found that defining a list of strings without separating the strings with a comma is not a syntax error. When running this code: ...
Redz's user avatar
  • 1,096
11 votes
2 answers
911 views

Suppose I have a block scoped language, in this case represented ...
mousetail's user avatar
  • 9,627
-5 votes
1 answer
236 views

In Python, you use the term print. If there was another language that worked in the exact same way as Python, but used slightly different terms (like ...
taylor.2317's user avatar
12 votes
4 answers
3k views

In Python, everything is treated as an object. This means that CPython interpreter will decide on the fly, what is the type of each variables or the function return type depending on the current state....
Hemanth Haridas's user avatar
-4 votes
1 answer
207 views

Does it: first compile all the code into bytecode, and only then executes it, or does it compile the minimum possible piece of code and executes immediately? For example, this code: ...
чистов_n's user avatar
5 votes
2 answers
539 views

A lot of languages have some form of constant variables - hell, even JavaScript has them. Yet Python doesn't. What possible benefits does this have for the Python language?
lyxal's user avatar
  • 2,045
7 votes
1 answer
232 views

Java-family languages often use a package declaration at the top of a source file, to group source files into modules/packages independently of their file system ...
Ginger's user avatar
  • 2,707

15 30 50 per page