arturoqu / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

Change module name from twitter to something else. #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is just a suggestion, the module itself is working great. I had to
rename the django app I was working on from 'twitter' to something else to
avoid import conflicts with python-twitter. I would suggest you change the
name of this module to something less generic.

Some examples from similar projects:

The python wrapper for flickr's api (http://flickrapi.sourceforge.net) is
called flickrapi.

Delicious python wrapper
(http://www.michael-noll.com/wiki/Del.icio.us_Python_API) is deliciousapi

Original issue reported on code.google.com by jonles...@gmail.com on 29 Jun 2008 at 9:44

GoogleCodeExporter commented 9 years ago
That's a great idea, but how could we do that without breaking existing code?

Original comment by dclinton on 10 Jul 2008 at 9:50

GoogleCodeExporter commented 9 years ago
I vote for this too -- existing code fix is a simple find-replace for "twitter" 
to
"twitterapi" or whatever name is chosen.

twitterapi, please please. Right now I've got to do all sorts of contortions 
because
I can't have a module called twitter.py without using absolute_import.

Original comment by iga...@gmail.com on 18 Sep 2008 at 6:01

GoogleCodeExporter commented 9 years ago
That sounds reasonable to me, but we still need to know how to do it without 
breaking
everyone currently using the module.

Original comment by dclinton on 18 Sep 2008 at 6:05

GoogleCodeExporter commented 9 years ago
Is it truly so bad to change the name, along with an explanation along the 
lines of:

If you were previously using python-twitter and would like to make the minimal 
amount
of code changes, then edit your import lines from:

import twitter

to

import twitterapi as twitter

I can't say how many people are using python-twitter today, and how many people 
for
whom this change would impact their daily lives, but a breaking change that is
fixable with a global find/replace is an entirely different animal than 
changing a
method signature or some other logic.

I understand the desire to have zero impact on existing code, but I don't think 
that
it's possible to have a zero-impact solution for a module name change, and I 
don't
think that the "solution" that I've proposed is terribly onerous for people who 
will
upgrade their installations.

Your call in the end, but I'd seriously prefer not to have to roll a modified 
copy of
python-twitter into my app, or maintaining a fork that tracks your trunk and 
changes
twitter -> twitterapi.

Original comment by iga...@gmail.com on 18 Sep 2008 at 8:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I second igazit's comment.

Consider this posting this line on the main page:
Future revisions (eg: 0.7 and above) of the twitter module will be named 
twitterapi. 
To maintain compatibility with code you're currently writing, v0.6 and prior 
should
be imported as follows until the change is made:

import twitter as twitterapi

Original comment by sam%odio...@gtempaccount.com on 27 Sep 2008 at 7:33

GoogleCodeExporter commented 9 years ago
Well, in reply to comment #6:

If the goal is to allow people to name their modules 'twitter' then people 
wishing to
get 0.6-style behavior will also need absolute imports.The warning should 
probably
say so, along the lines of:

from __future__ import absolute_import
import twitter as twitterapi

Like I said before, not ideal, but it will hurt more to make this breaking 
change
later on when there is yet more existing code to break.

Original comment by iga...@gmail.com on 5 Oct 2008 at 4:50

GoogleCodeExporter commented 9 years ago
I made a small tweak in twitter.py to make it possible for the end user to 
rename it
by hand (to whatever they like).  Marking won't fix, not because it isn't a good
idea, but because the suggest change breaks all users for a relatively small 
gain for
a few.

Original comment by dclinton on 21 Jan 2009 at 7:52