4
votes
2answers
196 views

What are the key differences between Java's and Python's OOP support? [closed]

The only language I've ever used is Java. I like it a lot but decided it's time to learn another language :) . I'm interested in learning Python. It seems like a good choice because it's partly ...
0
votes
0answers
19 views

How to deal with multiple output modes of multiple types?

Note: The business domain being a bit complicated to explain, I replaced the names of actual classes by more illustrative examples. I'm writing an application in which the business layer returns a ...
2
votes
0answers
69 views

The inheritance argument of zope.interface (providedby vs isinstance)

What limitations does inheritance of an interface through an abstract base class present that are addressed by zope.interface? In the following talk given in 2010 by Jeff Rush about interfaces, at ...
-1
votes
2answers
252 views

Utterly Confused with OOP - How do I overcome a beginner's hurdle? [closed]

I have been reading and working through the exercises of Steve Lott's book Building Skills in Python. However, on the very first exercise dealing with OOP I have gotten completely stuck. The problem ...
10
votes
9answers
2k views

Is there any difference learning OOP on different programming languages? [closed]

I want to learn OOP. I know Python and I know very little things about OOP. But when I search for "learn OOP" in forums I saw a guy saying that "Python is so new that's why you can't learn OOP on ...
1
vote
1answer
118 views

Dynamic method creation in python

I have a class that will have a number of external methods that will all call the same smaller set of internal methods. So something like: obj.method_one(a, c) and obj.method_two(a, c) where ...
4
votes
3answers
193 views

Python: How to decide which class' methods should provide behavior (functionality) affecting multiple classes

I have a question about object oriented design that is not specific to Python but since my code is in Python, I tagged it as such. How do I decide which of my classes should be responsible for ...
1
vote
2answers
177 views

OO way to gather together data from multiple objects without getters

I'm writing a system that has a number of objects with data in them. For example one object has a user name attribute, another has a date, another shopping cart item etc. I'm making an object that ...
4
votes
1answer
636 views

Objects of different programming languages

Apparently, there are some resemblance between objects in JavaScript and dictionaries in Python. Each language defines an object a little different (and there is some logic that all definitions to be ...
0
votes
2answers
159 views

Python — when should a class have-a rather than be-a?

This is related to "Extends is evil" vs. OCP? but separate because the idea of "implement the interface" doesn't exist in Python. I'm writing a class to pull some data off a webpage. It's ...
1
vote
1answer
507 views

Why are methods considered the class attributes in Python?

I read in a book that both methods and fields are considered the attributes of a class in Python. However, recently I was told by a friend of mine that methods may not be considered the attributes of ...
2
votes
2answers
220 views

Start by Teaching Classes [closed]

In every class, and every book I have seen regarding programming, classes are held off. They are thought to be confusing and strange. I certainly had issues with them. But in object orient ...
3
votes
1answer
199 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 ...
2
votes
0answers
110 views

How to restructure Python frameworks [duplicate]

I just joined a group of five developers (non-professionals) working on a medium sized Python framework (> 50 modules, > 10.000 lines of code). The project has no documentation whatsoever and there ...
4
votes
1answer
659 views

How to design a composite pattern in Python?

The concept I'm programming an interface over pygame as a personal project, to make the creation of games easier for me. So far I managed to design an architecture that behaves like this : Objects ...
7
votes
1answer
458 views

Object oriented vs vector based programming

I am torn between object oriented and vector based design. I love the abilities, structure and safety that objects give to the whole architecture. But at the same time, speed is very important to me, ...
0
votes
2answers
202 views

What is the convention regarding class names that may already exist in the ORM?

This is a generic question about class names and ORMs, but for context; I'm working on a Flask web app in Python using SQLalchemy. I'm struggling with naming a new class that will contain the ...
1
vote
3answers
347 views

Hacking Python “Requests” library.. How to start as an intermediate pythonista?

My question is conceptual, yet extremely vital for me. I'm an intermediate Python developer. I know fair enough about it, and actually use it on a daily basis. Now, I would like to transform my ...
21
votes
6answers
2k views

Functional programming compared to OOP with classes

I have been interested in some of the concepts of functional programming lately. I have used OOP for some time now. I can see how I would build a fairly complex app in OOP. Each object would know how ...
-1
votes
1answer
233 views

Using dot to Access Object Attribute and Proper abstraction

I have been programming in python and Java for quite a number of years and one thing I find myself doing is using the setters and getters from Java in Python but a number of blogs seem to think using ...
1
vote
1answer
219 views

How to use OO for data analysis? [closed]

In which ways could object-orientation (OO) make my data analysis more efficient and let me reuse more of my code? The data analysis can be broken up into get data (from db or csv or similar) ...
2
votes
1answer
388 views

Python simulation-scripts architecture

Situation: I've some scripts that simulate user-activity on desktop. Therefore I've defined a few cases (workflows) and implemented them in Python. I've also written some classes for interacting with ...
4
votes
2answers
369 views

Program more professionally (planning, notation, …)

I program a data-analysis framework for my company (20000LOCs by now). There are 2 programmers who help writing individual module for interfaces I have predefined. So far I haven't used much planning ...
6
votes
3answers
1k views

Various programming concepts (from a Python viewpoint)

Ever since I've started lurking on stackoverflow, I keep coming across programming concepts such as abstract classes, virtual functions, contracts, interfaces, etc., from a questions about other ...
0
votes
1answer
3k views

What are C's advantages over OOP languages, other than performance? [duplicate]

Possible Duplicate: When to use C over C++, and C++ over C? C still has its own importance in the programming world! And one reason for it is its performance. But, I have some questions. ...
0
votes
3answers
1k views

Translating between Python-Django and Javascript

I have a conceptual question about 'translating' between objects I have stored in Django (in Postgres) that I want to use on the front-end. So I have a user object in Python that holds basic things: ...
1
vote
1answer
1k views

Python Class Layout - Conventions

What is the proper or standard way to layout a class. If a class where to have attributes, methods, private attributes, private methods, class property (methods), and class methods. I am done 99% of ...
6
votes
1answer
3k views

Python programming patterns and practices? [closed]

What are the best python programming patterns and practices you are using every day? I don't mean only design patterns (there are lot of OO design patterns that can be used in python), I mean pure ...
1
vote
2answers
114 views

Expanding knowledge of python / Next book and/or Topic to read/research

I have been programming python and web apps awhile now but never delved very deep into OOP. I use classes all the time but I am pretty sure i am not fully getting what I could get from OOP. So today I ...
11
votes
9answers
3k views

Why are inheritance and polymorphism so widely used?

The more I learn about different programming paradigms, such as functional programming, the more I begin to question the wisdom of OOP concepts like inheritance and polymorphism. I first learned ...
7
votes
3answers
3k views

Differences between “Java OOP” and “Pythonic OOP”? [closed]

I started with ActionScript 2.0 and then went on with Java. I have learned, or at least used, a bunch of languages since then, including Python (probably my favorite). I'm afraid that my style of ...