Statistics
| Branch: | Tag: | Revision:

root / lib / compat.py @ 712da82f

History | View | Annotate | Download (4.3 kB)

# Date Author Comment
4a3dd52d 12/11/2012 01:01 pm Michael Hanselmann

Add utility function to create frozenset with unique values

When used instead of a plain call to “frozenset”, this would have
avoided the issue fixed in commit e2dd6ec. The new function is located
in the “compat” module as it will be used at module load time in most...

1dd64393 11/10/2011 03:50 pm Guido Trotter

Fix newer pylint's E0611 error in compat.py

These are triggered by our "stay-compatible" approach.

Signed-off-by: Guido Trotter <>
Reviewed-by: René Nussbaumer <>

b459a848 08/30/2011 11:24 am Andrea Spadaccini

DeprecationWarning fixes for pylint

In version 0.21, pylint unified all the disable-* (and enable-*)
directives to disable (resp. enable). This leads to a lot of
DeprecationWarning being emitted even if one uses the recommended
version of pylint (0.21.1, as stated in devnotes.rst)....

e687ec01 08/25/2011 01:53 pm Michael Hanselmann

PEP8 style fixes

Identified using the “pep8” utility.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

eb62069e 08/03/2011 01:37 pm Iustin Pop

Add two more compat functions

operator.itemgetter(0) → fst
operator.itemgetter(1) → snd

snd is not used yet, but it makes sense to add both.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

23e0ef8c 06/29/2010 05:30 pm Guido Trotter

Fix a few uncommon pylint errors in compat.py

- It's ok if the optional modules functools, roman and hashlib are not there.
- It's ok to reference any and all before defining them. We're doing all
this exactly because, under python 2.4, they are undefined....

403f5172 06/28/2010 02:04 pm Guido Trotter

Remove pred from compat.any/all

This makes it compatible with the python builtin, and we can even use
the builtin when running under the right version of python. The all and
any functions are renamed to _all and _any, so that they can be tested,
and (non)existing unittests are updated (translation: there are no unit...

d4d1e3dd 06/01/2010 01:37 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    Convert gnt-instance list and info to use roman
    gnt-cluster info --roman
    FormatUidPool: provide optional roman conversion
    gnt-node: remove latinfriendlyfields
    Move roman conversion to compat
    Add a new opcode timestamp field...
6396164f 06/01/2010 01:22 pm Guido Trotter

Move roman conversion to compat

The new TryToRoman function provides optional easy to use roman
conversion. Nunc cum demonstrationi unitati.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

716a32cb 06/01/2010 11:34 am Guido Trotter

Move hash functions to the compat module

Since the hash functions' changed their module name between python 2.4
and 2.6, and we have to do an try/import/except trick, we'll do it just
once, for both hash functions, and in compat.py. This also fixes a use...

cea881e5 04/21/2010 08:48 pm Michael Hanselmann

Add separate module for backported language functionality

utils.py, where they were before, is already huge.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>