Skip to content

Commit

Permalink
Merge pull request #1321 from denisalevi/patch-1
Browse files Browse the repository at this point in the history
Fix wrong preference example in documentation
  • Loading branch information
mstimberg committed Jul 7, 2021
2 parents d97ff3a + d70fa01 commit c7fb088
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs_sphinx/advanced/preferences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ Preferences

Brian has a system of global preferences that affect how certain objects
behave. These can be set either in scripts by using the `prefs` object
or in a file. Each preference looks like ``codegen.c.compiler``, i.e. dotted
or in a file. Each preference looks like ``codegen.cpp.compiler``, i.e. dotted
names.

Accessing and setting preferences
---------------------------------
Preferences can be accessed and set either keyword-based or attribute-based.
The following are equivalent::

prefs['codegen.c.compiler'] = 'gcc'
prefs.codegen.c.compiler = 'gcc'
prefs['codegen.cpp.compiler'] = 'unix'
prefs.codegen.cpp.compiler = 'unix'

Using the attribute-based form can be particulary useful for interactive
work, e.g. in ipython, as it offers autocompletion and documentation.
In ipython, ``prefs.codegen.c?`` would display a docstring with all
the preferences available in the ``codegen.c`` category.
In ipython, ``prefs.codegen.cpp?`` would display a docstring with all
the preferences available in the ``codegen.cpp`` category.

Preference files
----------------
Expand Down

0 comments on commit c7fb088

Please sign in to comment.