Trac 17337: use the empty set to generate IntegerModRing(1)
Trac 17338: fix printing of Dirichlet characters modulo 1 and 2
Move preparsing, loading and attaching to src/sage/repl
Support PEP 3127 Integer literals
Re-implement _safe_repr() in Sage
Trac #17337: Use the empty set to generate IntegerModRing(1)

The following choice of generators for two trivial groups is somewhat
inconsistent:
{{{
sage: Zmod(1).unit_gens()
(0,)
sage: Zmod(2).unit_gens()
()
}}}
It would be better to use the empty set as a set of generators for the
unit group of `Zmod(1)` as well.

The main adaptation that this requires is that `DirichletGroup(1).0` no
longer works (this group is also generated by the empty set) and needs
to be changed to `DirichletGroup(1)[0]`.

URL: http://trac.sagemath.org/17337
Reported by: pbruin
Ticket author(s): Peter Bruin
Reviewer(s): Volker Braun
Trac #17338: Fix printing of Dirichlet characters

Dirichlet characters modulo 2 are printed in a strange way:
{{{
sage: DirichletGroup(2)[0]
Dirichlet character modulo 2 of conductor 1 mapping
}}}
After #17337, this also happens for Dirichlet characters modulo 1.

This ticket makes Dirichlet characters modulo 1 and 2 print as
{{{
sage: DirichletGroup(1)[0]
Dirichlet character modulo 1 of conductor 1
sage: DirichletGroup(2)[0]
Dirichlet character modulo 2 of conductor 1
}}}
and uses the `mapping ...` only for conductors >= 3:
{{{
sage: DirichletGroup(3)[1]
Dirichlet character modulo 3 of conductor 1 mapping 2 |--> -1
}}}

URL: http://trac.sagemath.org/17338
Reported by: pbruin
Ticket author(s): Peter Bruin
Reviewer(s): Volker Braun
Trac #17396: Move preparsing, loading and attaching to src/sage/repl

Move some files/functions around to put them in more logical places.

URL: http://trac.sagemath.org/17396
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Volker Braun
Trac #17413: Integer: support PEP 3127 octal literals

This should work:
{{{
sage: Integer("0o10")
8
}}}

See https://www.python.org/dev/peps/pep-3127

The old-style literals like `"012"` should be deprecated.

URL: http://trac.sagemath.org/17413
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Volker Braun
Trac #17418: IPython master compatibility: remove _safe_repr()

IPython upstream decided to replace `_safe_repr()` with plain `repr()`:
[https://github.com/ipython/ipython/commit/ee5477092243c6994ec021dc5d98b
773d99ef7f2]

Since we'll probably upgrade to IPython 3.0.0 sooner or later, let's
make remove the use of `_safe_repr()` in Sage now. Due to Sage's use of
`warn_format_error`, it's better to re-implement `_safe_repr()` in Sage
instead of simply replacing `_safe_repr()` by `repr()`.

URL: http://trac.sagemath.org/17418
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Volker Braun