Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
0 answers
77 views

A Haskell-style "maybe" type in Python, version 2

I have decided on a preferred solution to my question A maybe type in Python. Which implementation is best?, and have expanded it to be more ergonomic. I have implemented a host of utility functions (...
schuelermine's user avatar
4 votes
2 answers
749 views

MP3 Playlist Class in Python

Background Info I am an intermediate level Python programmer. This is my implementation of a MP3 Playlist class challenge that was hosted on 101 Computing.Net. The ...
Seraph776's user avatar
  • 201
-2 votes
1 answer
67 views

python - class not returning the expected result. I am using function and a class [closed]

I am trying to pass 2 values from a function to the class and get a result from the class. For example, if I send value "dog" I should get the result as "dog runs" as a returned result. Need help with ...
Gunasekar Desaiyan's user avatar
2 votes
0 answers
61 views

Dispatch different parameters to different classes with single interface [closed]

I have a set of classes that have similar funcionality but very different interfaces. I created two interface classes with polymorphic methods so I can operate over then. When creating calling the ...
Ivan's user avatar
  • 189
1 vote
1 answer
150 views

Models for analysing Twitter data (*which based on tweepy package)

I have three modules here models.py, functionals.py, and adjustment.py. These three may be ...
Redsbefall's user avatar
  • 1,212
15 votes
1 answer
2k views

Flask view dependency injection

I've been into trying to have an as simple as possible dependency container in Python and with your help managed to conceive TinyDIC, many thanks. Now, I use Flask for my apps, and from by background ...
user avatar
3 votes
1 answer
2k views

Object-oriented web scraping with Python

I usually write function-only Python programs, but have decided on an OOP approach (my first thereof) for my current program, a web-scraper. Here is the working code I wrote which I am looking to have ...
Pyderman's user avatar
  • 215
2 votes
2 answers
103 views

OOP, FP and IMP condensed in Rock, Paper and Scissors

Rock Paper and Scissors is a pretty basic program. The reason I wrote this program is because I wanted to see what a small script that used all of the main programming paradigms looked like. My code ...
Caridorc's user avatar
  • 28k
3 votes
1 answer
1k views

Python Vector implementation that acts as a class and also a collection of staticmethods

Recently I've been wondering about ways of implementing objects in code that can be represented by other primitives. An example of this is a Vector, which can be represented by a Vector\$N\$D where \$...
user3002473's user avatar
12 votes
1 answer
466 views

Refractoring OOP vs. Functional Programming Approach

I am writing a python script that will call mandrills export activity api for every blog on a worpress mu install except for the main site. The script is designed to be called from a cron job on a ...
TaylorHicks's user avatar