Python 3 is the latest version of the Python programming language and was formally released on December 3rd, 2008.

learn more… | top users | synonyms

1
vote
1answer
77 views

More efficient alternative that checks if a list can be made a palindrome

I asked this question on Stackoverflow, but they told me this is the best place to ask. For my algorithms and data structures class, I have to write an algorithm that is more efficient in the worst ...
3
votes
3answers
171 views

closure property of datatype “tuple” in python

From this link, below is the slide that I would like to understand: The Closure Property of Data Types A method for combining data values satisfies the closure property if: The result of ...
1
vote
1answer
214 views

Building Data abstraction for rational numbers using “objects”

I follow this definition of "object":An object is a value exporting a procedural interface to data or behavior. Objects use procedural abstraction for information hiding, not type abstraction. Object ...
0
votes
0answers
5 views

Input to list and opperate on [migrated]

I've just started with Python (3.), and while it is fairly easy to pick up, I'm trying to learn how to work with lists. I've written a small program which asks for the amount of numbers to input, ...
-3
votes
1answer
191 views

Why every value is an object in python?

I know about writing programs (using C) that have: Data values, that are manipulated. For example: integer, float values etc.. functions (rules), by which data values are manipulated. object is a ...
-1
votes
1answer
62 views

Significance of '__name__ ' attribute in python

1) Below python code, >>> def f(): return creates a function type object which has __name__ attribute with value 'f' which looks fine. But, 2) Below line of code, >>> x = ...
-4
votes
4answers
122 views

Does this python program obey functional paradigm?

Below is the hailstone sequence program considering the rule of thumb in functional programming. The simple rule of thumb is: if you can replace any expression, sub-expression or subroutine call ...
1
vote
1answer
113 views

How do I enforce 'referential transparency' in this program?

Below is the python program written to follow the rule of thumb in functional programming. The simple rule of thumb is: if you can replace any expression, sub-expression or subroutine call with ...
1
vote
0answers
37 views

Persist data downloaded by Celery workers

I'm working in a tool that downloads tweets from Twitter to process them later. For this purpose I'm using Celery with RabbitMQ, sending task with the keywords that must be tracked by the workers. My ...
0
votes
1answer
56 views

how python updates references to variables

For this while loop below. It is clear how the v1,v2,v3 are updated to new data objects based on the equation. But I do not understand how u1,u2,u3 retains the original values of v1,v2,v3.Can someone ...
1
vote
1answer
49 views

Is this type of data insertion safe and can stop sql injection in Python?

I am learning Database connection from MySQL Connector/Python Developer Guide. This is the code I am using to insert data: conn = mysql.connector.connect(user="user", password="password", ...
39
votes
2answers
3k views

Why do some languages round to the nearest EVEN integer?

Programming languages like Scheme (R5RS) and Python (see this Question) round towards the nearest even integer when value is exactly between the surrounding integers. What is the reasoning behind ...
4
votes
2answers
3k views

Why doesn't Python have a “flatten” function for lists?

Erlang and Ruby both come with functions for flattening arrays. It seems like such a simple and useful tool to add to a language. One could do this: >>> mess = [[1, [2]], 3, [[[4, 5]], 6]] ...
2
votes
2answers
163 views

Is this looping solution possible with recursion?

Eventually, I would like to generalize this solutions to work with a Tuple of any length. I think recursion is required for that, but I haven't been able to do it. def combineRanges(maxValues) : ...
1
vote
0answers
316 views

Python Compare Values from 2 Columns from two separate CSV files

I am using Python. I have two columns(in separate CSVs) that contain an ID tag. Ideally, I would like to add on columns of information from one CSV to the other whenever the ID tag matches. For the ...
1
vote
1answer
114 views

Additional actions in setup.py for install

Background So, I'm developing a project, and I'm writing setup.py script for it, using distutils. I'm using CPython3.3. I use some libraries that have invalid distributions in PyPI, so they have to ...
1
vote
2answers
170 views

Is using os.environ to store the value of command line switches pythonic?

I write CLI-executable Python 3 scripts regularly to do data compilation and some maintenance tasks, and try to adhere to PEP 8 and the Google Python Style Guide when doing so. Google's guide says to ...
2
votes
2answers
399 views

What was the need of introducing Python 3 when we already had Python 2 [duplicate]

I am still learning python and I started with Python 3. This question not Python 2 vs 3 or difference between them like print() is a function and not language construct and 3/2 = 1.5 My question is ...
3
votes
1answer
215 views

What is the advantage of determining scopes statically and using them dynamically in case of Python?

Firstly let me clarify that I know C and am learning Python. So my OOPS is kind of bad. I was reading the official tutorial and found this Although scopes are determined statically, they are ...
1
vote
2answers
1k views

Why do people consider Python a weak language? [closed]

I've been using Python for a little while now and I am enjoying it, but a few of my friends are telling me to start using a language like C# or Java instead and give these reasons: Python is a ...
-1
votes
1answer
297 views

Would porting JPype to Python 3 be useful? [closed]

I have an open source project my company would like me to do with a small team, creating an adapter for the Oracle NoSQL database to be used in Python, but to do that we would need to be able to make ...
16
votes
1answer
568 views

What are the problems python 3 new features solve?

Python 3 new features say: we’re mostly fixing well-known annoyances and warts, and removing a lot of old cruft It mentions what is different (the fix) but not why (the problems). I have have ...
3
votes
1answer
1k views

understanding the encoding scheme in python 3

I got this error in my program which grab data from different website and write them to a file: 'charmap' codec can't encode characters in position 151618-151624: character maps to <undefined> ...
4
votes
2answers
556 views

Should I start developing in Python 3? [duplicate]

Possible Duplicate: Should we use python 2.6 or 2.7 or 3.x? Now that Django runs on Python 3, I think it's time to ask that all-important question: Should I start using Python 3 instead of ...
1
vote
1answer
296 views

What features are missing from Python IDE tools?

What are the most desired features currently lacking in any Python IDE tools? I'm also interested in what's missing in Komodo 6 but available in other tools (I currently use Komodo 6 for Python 3 ...
20
votes
5answers
2k views

Will Python 3.0's backwards-incompatibility affect adoption?

I visited Slashdot this morning to find out that Python 3.0 has been released. I know C# and Perl, but have wanted to learn Python for some time, especially after I saw its ease of use to create ...