Python Forum
ABC Module and @property decorator, Pythonic Way?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ABC Module and @property decorator, Pythonic Way?
#21
https://docs.python.org/3/reference/data...t.__repr__ Wrote:object.__repr__(self)
Called by the repr() built-in function to compute the “official” string representation of an object. If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment). If this is not possible, a string of the form <...some useful description...> should be returned. The return value must be a string object. If a class defines __repr__() but not __str__(), then __repr__() is also used when an “informal” string representation of instances of that class is required.

This is typically used for debugging, so it is important that the representation is information-rich and unambiguous.
Reply
#22
(Aug-18-2021, 05:16 PM)deanhystad Wrote: Software development. Mostly machine controls. Python is new to me, but it is in demand and I need to adapt.

I hear that. I see a lot of coders that their only regret was not learning Python first. That's when I said, "I need to learn this."

I am learning Python to get into a career coding python or just using it as a tool for other entrepreneurial projects. I need to brush up on SQL, CSS, HTML5 as well. I am very well versed in regex.

I was out of the game for 15 years do to some health issues. I am on disability and have all the time I need to learn and re-learn all the things that are lost to me. I was an affiliate marketer/web developer for many years.

How long have you been learning Python?

Here is a video of Raymond Hetinger encouraging the use of the ABC abstract module.

Who is he anyway?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  the order of running code in a decorator function akbarza 2 518 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Curious about decorator syntax rjdegraff42 14 2,084 May-03-2023, 01:21 PM
Last Post: rjdegraff42
  Subclass initialized property used in parent class method. Is it bad coding practice? saavedra29 5 1,757 Feb-07-2022, 07:29 PM
Last Post: saavedra29
  @property vs __set__ / __get__ and __setattr__ / __getattr__ okhajut 1 3,321 Jun-15-2021, 03:48 PM
Last Post: snippsat
  Can property getters and setters have additional arguments? pjfarley3 2 3,042 Oct-30-2020, 12:17 AM
Last Post: pjfarley3
  decorator adamfairhall 0 1,553 Aug-18-2020, 08:38 AM
Last Post: adamfairhall
  Property price calculation oli_action 4 3,143 Jul-15-2020, 04:27 PM
Last Post: sridhar
  Use of @property decorator ruy 16 6,517 Jun-09-2020, 05:29 PM
Last Post: buran
  which is "better" (or more Pythonic)? Skaperen 2 2,041 Feb-01-2020, 03:10 PM
Last Post: Skaperen
  which is "better" (or more Pythonic)? Skaperen 7 3,220 Feb-01-2020, 03:51 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020