documentation on cell styles appears to be wrong

Issue #1011 wontfix
Unknown
created an issue

I have concerns about the following page:

https://openpyxl.readthedocs.io/en/stable/styles.html#cell-styles-and-named-styles

It states that "Cell styles are shared between objects and once they have been assigned they cannot be changed." I believe that this is not true, e.g., one can do the following:

from openpyxl.styles import colors from openpyxl.styles import Font, Color from openpyxl import Workbook wb = Workbook() ws = wb.active

a1 = ws['A1'] red = Font(color=colors.RED) blue= Font(color=colors.BLUE) a1.font= red a1.font= blue

(At least, it runs without generating any error).

One can even do this:

red.color= colors.BLUE

So, I'd like to suggest that the above text be reworded as follows: "Cell styles are shared between objects. Consequently, once a cell style has been assigned, attributes cannot be changed on a cell-by-cell basis. One can modify an attribute of the style, in which case this affects all cells to which that style has been applied."

Phillip M. Feldman

Comments (1)

  1. Log in to comment