-1

I get a warning when doing:

new_header = header._replace(dependency_table_offset=dependency_table_offset)

I'm making a new namedtuple with a replaced attribute using ._replace.

Why does it give me this warning in PyCharm? Is there a way I should be doing this differently?

Gino Mempin
  • 19,150
  • 23
  • 79
  • 104
6x2KYqRT
  • 33
  • 4
  • What is `header`? Is it a class that you defined? – Gino Mempin May 09 '22 at 03:22
  • It's an property of an instance in a defined class. – 6x2KYqRT May 09 '22 at 03:25
  • 1
    Does this answer your question? [How to suppress warning "Access to protected member" in pycharm method?](https://stackoverflow.com/questions/56440753/how-to-suppress-warning-access-to-protected-member-in-pycharm-method) – Gino Mempin May 09 '22 at 03:25
  • There are a number of existing posts on handling this warning on Pycharm, but they differ a bit based on the object and how the `_method` is accessed. So, I'm thinking showing an example of how/where `header` is used could you help you find an answer. – Gino Mempin May 09 '22 at 03:27

0 Answers0