Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07253e0

Browse files
Fix #12 by building a better dynamic class name
1 parent 6a48e04 commit 07253e0

File tree

1 file changed

+1
-1
lines changed
  • gang-of-four/composition-over-inheritance

1 file changed

+1
-1
lines changed

gang-of-four/composition-over-inheritance/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ that creates new classes dynamically at runtime:
11641164

11651165
# Build a new derived class (!)
11661166

1167-
name = filter_name.replace('Log', '') + output_name
1167+
name = filter_name.title() + output_name.title() + 'Log'
11681168
cls = type(name, (filter_cls, output_cls), {})
11691169

11701170
# Call it as usual to produce an instance.

0 commit comments

Comments
 (0)