Hello everyone,
I've got a question about class design. I want to model classes like
these (examples):
#
class BaseItem(object):
def __init__(self, ident, name, description):
self.ident = ident
self.name =
"Knacktus" wrote
I've got a question about class design. I want to model classes like
these (examples):
Since these only really have data and inheritance should be based on
behaviour its almost impossible to make a meaningful decision on what
the inheritance tree should look like.
However..
Hi everyone,
We have a project at work where myself and a co-developer are setting up
Django. Our version control software of choice is TortoiseSVN.
When doing a project update from SVN, it pulls the server version to the
local project. When checking code in, it overwrites the server version of
t
Thanks a lot, your explanations are very helpful getting a better (right)
understanding about the ideas behind inheritance.
Cheers,
Jan
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman
# so that ET preserves your namespaces
ET._namespace_map["http://www.w3.org/2001/XMLSchema";] = 'xs'
# open your file explicitly specifying the correct mode
f = open('testing.xml', 'w')
xml_tree.write(f, encoding='UTF-8')
f.close()
___
Tutor maillist -
> We have a project at work where myself and a co-developer are setting up
> Django. Our version control software of choice is TortoiseSVN.
>
> When doing a project update from SVN, it pulls the server version to the
> local project. When checking code in, it overwrites the server version of the
justin.mailingli...@gmail.com, 16.08.2010 10:38:
# so that ET preserves your namespaces
ET._namespace_map["http://www.w3.org/2001/XMLSchema";] = 'xs'
# open your file explicitly specifying the correct mode
f = open('testing.xml', 'w')
xml_tree.write(f, encoding='UTF-8')
f.close()
Note that it'
Hi Evert,
You are right, I actually intended the question for the Django list - it was
a posting error. Thanks for the answer, we did soon figure out to exclude
the settings file from any SVN checkins/ checkouts. We will simply apply
this rule as it should be simple enough to observe and to make a
On Mon, 16 Aug 2010 05:01:58 pm Knacktus wrote:
> Hello everyone,
>
> I've got a question about class design. I want to model classes like
> these (examples):
>
> #
> class BaseItem(object):
> def __init__(self, ident, name, d
On Sat, Aug 14, 2010 at 6:17 PM, Bill Allen wrote:
> In the process of learning Python, I have given myself a programming
> exercise to do. This is a standard thing I do whenever learning a new
> programming language and I have used this same exercise several times before
> with other programming
My partner got ahead of the game last year, and installed 2.5.4, which
confounds matters when the other four participants when sharing some
python programs under Win XP. My guess is that if he uses control panel
add/remove for py 2.5.4, he can then successfully install 2.5.2 w/o
messing up any
On Mon, Aug 16, 2010 at 10:39 AM, Wayne Watson
wrote:
> My partner got ahead of the game last year, and installed 2.5.4, which
> confounds matters when the other four participants when sharing some python
> programs under Win XP. My guess is that if he uses control panel add/remove
> for py 2.5.4,
Hi All,
I know that I can look up the value for a particular key in a
dictionary, but can I look up the key associated with a particular
value? I understand that this could be problematic from the standpoint
of multiple keys having the same value, but even then I feel like Python
could just retur
On 8/16/2010 10:44 AM Chorn, Guillaume said...
Hi All,
I know that I can look up the value for a particular key in a
dictionary, but can I look up the key associated with a particular
value?
Yes. But you'll need to implement it. There are likely modules out
there that'll do this, but it'd t
The question is would going back likely cause problems? I'm dealing with
neophytes. He's messed up before.
On 8/16/2010 8:58 AM, Luke Paireepinart wrote:
On Mon, Aug 16, 2010 at 10:39 AM, Wayne Watson
wrote:
My partner got ahead of the game last year, and installed 2.5.4, which
confounds
> I know that I can look up the value for a particular key in a
> dictionary, but can I look up the key associated with a particular
> value?
I am using bidict in one of my projects:
http://pypi.python.org/pypi/bidict/0.1.1
It's probably a bit more complex than what I
need, but the parts I am u
The core issue here is: are there actually issues exacerbated by the
difference in Python versions? If so, which issues? There shouldn't
be hardly any reason to force you all to maintain the exact same
python version, especially if you're in the same sub-version (2.5)
On Mon, Aug 16, 2010 at 3:5
On Fri, Aug 13, 2010 at 2:38 PM, Adam Bark wrote:
> On 11/08/10 18:14, Eduardo Vieira wrote:
>
> On Tue, Aug 10, 2010 at 1:56 PM, Adam Bark wrote:
>
>
>
> The problem is you don't call make_dict unless there's a "FUEL SURCHARGE" or
> multiple pins. Also you don't add the first pin to mydict["trac
I guess it's a matter of bookkeeping. I don't need the extra hassle
dealing with one of them. I'll just let it go at 2.5.x
On 8/16/2010 2:41 PM, Luke Paireepinart wrote:
The core issue here is: are there actually issues exacerbated by the
difference in Python versions? If so, which issues?
On 8/16/2010 2:41 PM Luke Paireepinart said...
The core issue here is: are there actually issues exacerbated by the
difference in Python versions? If so, which issues? There shouldn't
be hardly any reason to force you all to maintain the exact same
python version, especially if you're in the sa
Chorn, Guillaume wrote:
Hi All,
I know that I can look up the value for a particular key in a
dictionary, but can I look up the key associated with a particular
value? I understand that this could be problematic from the standpoint
of multiple keys having the same value, but even then I feel li
What do you mean by subclass?
On Aug 16, 2010 3:26 PM, "Emile van Sebille" wrote:
On 8/16/2010 10:44 AM Chorn, Guillaume said...
>
> Hi All,
>
> I know that I can look up the value for a particular key in a
> dictionary, but can...
Yes. But you'll need to implement it. There are likely modul
"Chorn, Guillaume" wrote
dictionary, but can I look up the key associated with a particular
value?
Not directly but its not hard to do bearing in mind you will
get a collection back.:
d = {1:10,2:20,3:10,4:20}
val = 10
ks = [k for k in d if d[k] == val]
ks
[1, 3]
You need to trawl
Thanks Dave. Actually I figured out a relatively simple solution to my
specific problem--since the dictionary I made was the result of zipping
together two lists, I simply made a second dictionary with the lists
switched around after the zip command and used that. It worked in my
case because all
"Stefan Behnel" wrote
Note that it's best to hit "reply" when responding to other people's
postings.
Or on the tutor list make that ReplyAll! :-)
Alan G.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
ht
On Mon, Aug 16, 2010 at 9:25 AM, Luke Paireepinart
wrote:
>
> Anyone who finds this interesting may also want to look into
> http://inventwithpython.com/ , I hear it's a good book but I haven't
> personally worked through it.
>
>
> Very interesting, looks good!
Thanks,
Bill
__
On Tue, 17 Aug 2010 06:57:37 am Wayne Watson wrote:
> The question is would going back likely cause problems? I'm dealing
> with neophytes. He's messed up before.
There shouldn't be any differences you're likely to care about between
2.5.2 and 2.5.4, but if there is, your best approach is for you
On Tue, 17 Aug 2010 03:44:33 am Chorn, Guillaume wrote:
> Hi All,
>
> I know that I can look up the value for a particular key in a
> dictionary, but can I look up the key associated with a particular
> value? I understand that this could be problematic from the
> standpoint of multiple keys havin
On 8/16/2010 4:12 PM Huy Ton That said...
What do you mean by subclass?
If you need repeated access such that iterating over a large dict frequently
impacts performance, you could subclass dict and maintain a second index
allowing instant access to the keys associated with a specific value.
On Tue, 17 Aug 2010 09:12:39 am Huy Ton That wrote:
> What do you mean by subclass?
It's a fundamental term from object-oriented programming.
If you have a class that defines certain data and behaviour, you can
create a *subclass* that inherits the same data and behaviour, except
for specific e
No question about that. For the record, I'm not going to ask him to
change based on the answers here.
On 8/16/2010 5:14 PM, Steven D'Aprano wrote:
On Tue, 17 Aug 2010 06:57:37 am Wayne Watson wrote:
The question is would going back likely cause problems? I'm dealing
with neophytes. He's me
> Note that it's best to hit "reply" when responding to other people's
> postings. That way, mail readers can see the relation between the original
> posting and the reply and sort the reply into the right thread.
>
> Stefan
how's this?
btw, I am getting daily(?) digests of the posts via E-mail an
I am looking for some guidance about how to best utilize box drawing
characters(using unicode?) in as portable a way as possible in Python. Any
good guides out there for this?
Thanks,
Bill
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
> Stefan Behnel wrote:
Note that it's best to hit "reply" when responding to other people's
postings. That way, mail readers can see the relation between the original
posting and the reply and sort the reply into the right thread.
Comment to my own posting: as Alan noted already, "reply all" or
34 matches
Mail list logo