Skip to content

Strip out redundant __new__ to enable object pickling#548

Merged
geographika merged 1 commit into
geopython:masterfrom
vjf:strip_redundant_new
Nov 9, 2024
Merged

Strip out redundant __new__ to enable object pickling#548
geographika merged 1 commit into
geopython:masterfrom
vjf:strip_redundant_new

Conversation

@vjf
Copy link
Copy Markdown
Contributor

@vjf vjf commented Jan 7, 2019

I'd like to remove the redundant '__ new __' from the wfs classes in order to fix two problems:

  1. 'pickle' does not work (you cannot pickle the WFS classes)
  2. '__ init __' gets called twice each time the class is initialised. This creates a substantial performance lag on slower network connections.

See #520 for more information.

Thanks.

@cehbrecht cehbrecht added the wfs label Jan 7, 2019
@vjf vjf closed this Nov 8, 2019
@geographika
Copy link
Copy Markdown
Contributor

Reopening to check if this is still the case.

@geographika
Copy link
Copy Markdown
Contributor

The __new__ overrides date back to at least 15 years - e1d37a1
Since then OWSLib has moved from Python2 to Python3, I'm sure there was a reason at the time, but I can't see a need for the override now. Removing simplifies the code, removes duplicate calls to servers and resolves associated performance issues. Will be merging in the next 7 days - will leave open for comment until then.

Thanks @vjf for the fix.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 58.814% (-1.3%) from 60.156%
when pulling 4b9b7cf on vjf:strip_redundant_new
into ae98c20 on geopython:master.

@vjf
Copy link
Copy Markdown
Contributor Author

vjf commented Nov 3, 2024

@geographika @landryb Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants